LNK2019/2001: 无法解析的外部符号的解决方法

来源:互联网 发布:音画制作软件 编辑:程序博客网 时间:2024/09/21 06:37

在使用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之后,就不会出现上面的错误了。

阅读全文
0 0
原创粉丝点击