static 的误区
在ModelManager.h的声明了
class ModelManager{
public:
static cnrtModel_t createModel(const std::string& model_path);
...
};
在ModelManager.cc中,有如下实现:
static cnrtModel_t createModel(const std::string& model_path){
...
}
报编译错误:a storage class should not specified here;
将ModelManager.cc中的static删除后,就行了。具体原因上deepseek搜了一下,感觉还是不是很懂。记录一下,以后再回头看看。