在使用PCL库的时候发生了这样的错误:
错误 64
error LNK2019: 无法解析的外部符号 "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@YAXW4VERBOSITY_LEVEL@12@PBDZZ),该符号在函数 "public: void __thiscall pcl::detail::FieldMapper<struct pcl::PointXYZ>::operator()<struct
pcl::fields::x>(void)" (??$?RUx@fields@pcl@@@?$FieldMapper@UPointXYZ@pcl@@@detail@pcl@@QAEXXZ) 中被引用
D:\Programs\Fusion\Fusion.obj Fusion
错误 65
error LNK2001: 无法解析的外部符号 "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@YAXW4VERBOSITY_LEVEL@12@PBDZZ)
D:\Programs\Fusion\GarmentReconstructor.obj
Fusion
错误 66
error LNK2001: 无法解析的外部符号 "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@YAXW4VERBOSITY_LEVEL@12@PBDZZ)
D:\Programs\Fusion\TsdfVolume.obj Fusion
错误 67
error LNK2019: 无法解析的外部符号 "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ),该符号在函数 "public: __thiscall boost::thread_exception::thread_exception(int,char const
*)" (??0thread_exception@boost@@QAE@HPBD@Z) 中被引用
D:\Programs\Fusion\Fusion.obj Fusion
发生这样错误可能的原因:
①正确包含了所需要的头文件(.h文件),但是在源文件(.cpp)中没有相应方法的实现;
②正确包含了头文件(.h文件),但是没有导入相应的库文件(.lib文件);
③导入了库文件(.lib文件),但是库文件的位数和工程的位数不一致。
我就是发生了第三种情况,项目是32位的,但是安装的PCL是64位的。重新安装32位的PCL之后,就不会出现上面的错误了。

本文介绍了在使用PCL库时遇到的链接错误及其解决方案。错误包括LNK2019和LNK2001,通常由位数不匹配引起。文章详细分析了可能的原因,并给出了解决方案。

1729

被折叠的 条评论
为什么被折叠?



