Advertisement

使用PCL库在Qt中编译时遇到的问题:如何解决'boost::system::generic_category()'未定义的问题

阅读量:

前言:

ubuntu 16.04

刚完成PCL 1.8.1的安装

基于Qt环境进行c++开发

采用CMAKE作为构建工具

我所进行的操作如下:

在代码中引入了pcl相关头文件(即pcl的库)

例如:

#include
#include <stdio.h>
#include <stdlib.h>
#include <pcl/io/pcd_io.h>

using namespace std;

int main()
{
cout << "Hello World!" << endl;
return 0;

}

随后出现了以下错误提示:

main.cpp:(.text+0x86): undefined reference to `boost::system::generic_category()'

main.cpp:(.text+0x92): undefined reference to `boost::system::system_category()'

问题产生的根源在于PCL库内部依赖了boost库,但当前编译环境未能正确识别该库的存在。

为了解决上述问题,需要在CMakeList.txt中添加如下内容:

add_execut

全部评论 (0)

还没有任何评论哟~