问题描述
在将此代码迁移到 Visual Studio 2019 时,遇到了无法解决的问题。该代码在 Visual Studio 2017 中有效。但是当我将其复制到 2019 时,我无法以某种方式对其进行编译。在定义一个类时,我查看了 2019 年的差异,但我无法弄清楚具体如何去做。你能指导我吗?
编译时出错:
"Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "public: class std::vector<class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > >,class std::allocator<class std::vector<class std::vector<int,class std::allocator<int> > > > > > __cdecl Segmentation::process(void)" (?process@Segmentation@@QEAA?AV?$vector@V?$vector@V?$vector@HV?$allocator@H@std@@@std@@V?$allocator@V?$vector@HV?$allocator@H@std@@@std@@@2@@std@@V?$allocator@V?$vector@V?$vector@HV?$allocator@H@std@@@std@@V?$allocator@V?$vector@HV?$allocator@H@std@@@std@@@2@@std@@@2@@std@@XZ) ImageSegmentation C:\Users\user\source\repos\ImageSegmentation\ImageSegmentation\ImageSegmentation.obj 1
"
class Segmentation {
public:
Segmentation(cv::Mat lab,std::vector<seg_helper::min_span_tree::Edge>& edges)
{
for (int i = 0; i < lab.rows; i++)
for (int j = 0; j < lab.cols; j++) {
entry e1;
e1.id = j + i * lab.cols;
e1.parent = e1.id;
V_list.push_back(e1);
assert(e1.id == V_list.size() - 1);
}
this->edges = std::move(edges);
level_recorder.resize(1); //we don't want level 0,just empty
}
struct entry {
int id;
int parent;
int count = 1;
int level = 0;
double merging_cost = 0;
};
std::vector<entry> V_list;
std::vector<seg_helper::min_span_tree::Edge> edges;
std::vector<std::vector<entry> > level_recorder;
void merge(seg_helper::min_span_tree::Edge& edge);
int find(entry& u,std::vector<entry>& V_list);
std::vector<std::vector<std::vector<int> > > process();
};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)