需要精通C++,PCL的同志解决一些问题,有偿。


错误 11 error LNK2019: 无法解析的外部符号 "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@YAXW4VERBOSITY_LEVEL@12@PBDZZ),该符号在函数 "public: bool __thiscall pcl::visualization::PCLVisualizer::addPointCloud(class boost::shared_ptr<class pcl::PointCloud const > const &,class pcl::visualization::PointCloudColorHandler const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &,int)" (??$addPointCloud@UPointXYZ@pcl@@@PCLVisualizer@visualization@pcl@@QAE_NABV?$shared_ptr@$$CBV?$PointCloud@UPointXYZ@pcl@@@pcl@@@boost@@ABV?$PointCloudColorHandler@UPointXYZ@pcl@@@12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z) 中被引用 F:\【2】Urban Detect\Cloud\CloudView.obj Urban Detect


类似的问题有百十来个,如果有会的可以私信我,有偿解决问题。

这种LINK错误都是因为编译器只能找到函数的申明,但找不到函数实现的情况
如果用的第三方的东西,那是因为找不到函数所在的lib文件的位置

可能是以下三种情况,尝试逐一排查。

  1. 正确包含了所需要的头文件(.h文件),但是在源文件(.cpp)中没有相应方法的实现;

  2. 正确包含了头文件(.h文件),但是没有导入相应的库文件(.lib文件);

  3. 导入了库文件(.lib文件),但是库文件的位数和工程的位数不一致。