PCL 1.8.0安装:包含QtGui的编译错误

时间:2017-04-01 16:42:43

标签: ubuntu-14.04 qwidget point-cloud-library

我正在尝试按照these指令从源代码在我的Ubuntu 14.04计算机上构建PCL 1.8.0。但每次我收到以下错误:

[ 73%] Building CXX object apps/CMakeFiles/pcl_manual_registration.dir/include/pcl/apps/moc_manual_registration.cpp.o
In file included from ~/pcl/release/apps/ui_manual_registration.h:26:0,
             from ~/pcl/release/apps/include/pcl/apps/../../../../../apps/include/pcl/apps/manual_registration.h:37,
             from ~/pcl/release/apps/include/pcl/apps/moc_manual_registration.cpp:9:
/usr/include/vtk-5.8/QVTKWidget.h:40:25: fatal error: QtGui/QWidget: No such file or directory
    #include <QtGui/QWidget>
                     ^
compilation terminated.
make[2]: *** [apps/CMakeFiles/pcl_manual_registration.dir/include/pcl/apps/moc_manual_registration.cpp.o] Error 1
make[1]: *** [apps/CMakeFiles/pcl_manual_registration.dir/all] Error 2
make: *** [all] Error 2

对于locate QWidget我得到以下输出:

...
/usr/include/qt4/QtGui/QWidget
...
/usr/include/qt5/QtWidgets/QWidget
...

那么如何解决错误并安装pcl?

1 个答案:

答案 0 :(得分:0)

问题出现是因为您的配置试图在PCL构建期间混合Qt4和Qt5。 根据您提供的链接,PCL是假设的,因此在这种情况下针对Qt4构建。

尝试删除release目录中的所有内容,并使用正确版本的Qt重新初始化CMake配置。

就像那样(以下提供的例子):

cd ~/Documents/pcl
rm -rf relese
mkdir release 
cd release 
cmake -DCMAKE_BUILD_TYPE=Release -DPCL_QT_VERSION=4 -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON .. 
make