qt creator+PCL1.8.0配置,显示pcd文件

这些网上有好多介绍,在这里我就把我遇到的一些问题,网上没查到的写一下。


1.首先需要网上下载pcl那些东西,很多网站,如果没有的话,正常下不了,推荐用蓝灯了,下载完需要的东西卸了就好了。


2.安装pcl的时候,有三个注意的地方,首先在安装过程中,会弹出OpneNI的安装,需要安装在类似这个路径之下。         -------------- F:\PCL1.8.0\3rdParty\OpenNI2--------------

第二个需要注意的地方就是在下载将下载的pdb压缩包中的内容解压放到

到你PCL安装路径下的bin文件夹,就是里面有pcl开头的dll的那个文件夹

第三个需要注意的地方就是qt creator不识别空格,所以pcl在默认的安装路径的时候会带有空格比如XXX\PCL 1.8.0

这个时候就直接把空格删去就好了,省的以后麻烦。

安装完成之后记得重启电脑


3.完成之后需要在qt creator中的.pro文件中添加路径等等等等,这个时候注意按照自己的路径和安装版本进行更改

径什么的复制我下面的代码就好

INCLUDEPATH += F:\PCL1.8.0\3rdParty\OpenNI2\Include\


INCLUDEPATH += F:\PCL1.8.0\include\pcl-1.8\pcl


INCLUDEPATH += F:\PCL1.8.0\include\pcl-1.8\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\Boost\include\boost-1_61\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\Eigen\eigen3\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\FLANN\include\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\FLANN\include\flann\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\Qhull\include\


INCLUDEPATH += F:\PCL1.8.0\3rdParty\VTK\include\vtk-7.0\




CONFIG(debug,debug|release){


LIBS += F:\PCL1.8.0\lib\pcl_common_debug.lib\
        F:\PCL1.8.0\lib\pcl_features_debug.lib\
        F:\PCL1.8.0\lib\pcl_filters_debug.lib\
        F:\PCL1.8.0\lib\pcl_io_debug.lib\
        F:\PCL1.8.0\lib\pcl_io_ply_debug.lib\
        F:\PCL1.8.0\lib\pcl_kdtree_debug.lib\
        F:\PCL1.8.0\lib\pcl_keypoints_debug.lib\
        F:\PCL1.8.0\lib\pcl_ml_debug.lib\
        F:\PCL1.8.0\lib\pcl_octree_debug.lib\
        F:\PCL1.8.0\lib\pcl_outofcore_debug.lib\
        F:\PCL1.8.0\lib\pcl_people_debug.lib\
        F:\PCL1.8.0\lib\pcl_recognition_debug.lib\
        F:\PCL1.8.0\lib\pcl_registration_debug.lib\
        F:\PCL1.8.0\lib\pcl_sample_consensus_debug.lib\
        F:\PCL1.8.0\lib\pcl_search_debug.lib\
        F:\PCL1.8.0\lib\pcl_segmentation_debug.lib\
        F:\PCL1.8.0\lib\pcl_stereo_debug.lib\
        F:\PCL1.8.0\lib\pcl_surface_debug.lib\
        F:\PCL1.8.0\lib\pcl_tracking_debug.lib\
        F:\PCL1.8.0\lib\pcl_visualization_debug.lib
LIBS+=  F:\PCL1.8.0\3rdParty\Boost\lib\libboost_atomic-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_chrono-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_container-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_context-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_coroutine-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_date_time-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_exception-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_filesystem-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_graph-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_iostreams-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_locale-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_log_setup-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_log-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_c99f-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_c99l-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_c99-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_tr1f-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_tr1l-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_tr1-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_mpi-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_prg_exec_monitor-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_program_options-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_random-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_regex-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_serialization-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_signals-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_system-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_test_exec_monitor-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_thread-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_timer-vc140-mt-gd-1_61.lib\
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_type_erasure-vc140-mt-gd-1_61.lib
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_unit_test_framework-vc140-mt-gd-1_61.lib
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_wave-vc140-mt-gd-1_61.lib
        F:\PCL1.8.0\3rdParty\Boost\lib\libboost_wserialization-vc140-mt-gd-1_61.lib
LIBS+=  F:\PCL1.8.0\3rdParty\FLANN\lib\flann_cpp_s-gd.lib\
        F:\PCL1.8.0\3rdParty\FLANN\lib\flann_s-gd.lib\
        F:\PCL1.8.0\3rdParty\FLANN\lib\flann-gd.lib
LIBS+=  F:\PCL1.8.0\3rdParty\Qhull\lib\qhullstatic_d.lib\
        F:\PCL1.8.0\3rdParty\Qhull\lib\qhull_d.lib\
        F:\PCL1.8.0\3rdParty\Qhull\lib\qhull_p_d.lib\
        F:\PCL1.8.0\3rdParty\Qhull\lib\qhullcpp_d.lib\
        F:\PCL1.8.0\3rdParty\Qhull\lib\qhullstatic_r_d.lib
LIBS+=  F:\PCL1.8.0\3rdParty\VTK\lib\vtkalglib-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkChartsCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonColor-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonComputationalGeometry-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonDataModel-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonExecutionModel-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonMath-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonMisc-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonSystem-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkCommonTransforms-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkDICOMParser-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkDomainsChemistry-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkexoIIc-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkexpat-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersAMR-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersExtraction-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersFlowPaths-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersGeneral-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersGeneric-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersGeometry-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersHybrid-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersHyperTree-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersImaging-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersModeling-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersParallel-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersParallelImaging-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersProgrammable-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersSelection-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersSMP-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersSources-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersStatistics-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersTexture-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkFiltersVerdict-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkfreetype-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkGeovisCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkgl2ps-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkhdf5-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkhdf5_hl-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingColor-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingFourier-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingGeneral-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingHybrid-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingMath-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingMorphological-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingSources-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingStatistics-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkImagingStencil-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkInfovisCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkInfovisLayout-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkInteractionImage-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkInteractionStyle-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkInteractionWidgets-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOAMR-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOEnSight-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOExodus-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOExport-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOGeometry-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOImage-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOImport-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOInfovis-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOLegacy-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOLSDyna-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOMINC-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOMovie-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIONetCDF-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOParallel-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOParallelXML-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOPLY-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOSQL-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOVideo-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOXML-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkIOXMLParser-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkjpeg-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkjsoncpp-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtklibxml2-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkmetaio-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkNetCDF-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkNetCDF_cxx-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkoggtheora-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkParallelCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkpng-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkproj4-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingAnnotation-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingContext2D-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingContextOpenGL-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingFreeType-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingGL2PS-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingImage-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingLabel-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingLIC-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingLOD-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingOpenGL-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingVolume-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkRenderingVolumeOpenGL-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtksqlite-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtksys-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtktiff-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkverdict-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkViewsContext2D-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkViewsCore-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkViewsInfovis-7.0-gd.lib\
        F:\PCL1.8.0\3rdParty\VTK\lib\vtkzlib-7.0-gd.lib
LIBS+=  F:\PCL1.8.0\3rdParty\OpenNI2\Lib\OpenNI2.lib


} else {


}
 
  
 
  
更改完了pro文件之后记得选择构建-执行qmake,之后才能生效
 
  
 
  
 
  
这个时候注意修改两个地方,一个是安装的路径,另外一个就是你安装的版本问题!

比如说,我当时只关注了路径,而没有关注后面具体的版本问题
编译器报错:C1083:无法打开包括文件:"boost/shared_ptr.hpp":No such file or directory 

 
  
 
  
 
  
 
  
但是按照错误提示检查,在F:\PCL1.8.0\3rdParty\Boost\include\boost-1_61\boost中可以看到那个文件。
 
  
后来知道原因是我复制的在pro文件中关于boost的代码是

INCLUDEPATH += F:\PCL1.8.0\3rdParty\Boost\include\boost-1_59\

 
  
LIBS         F:\PCL1.8.0\3rdParty\Boost\lib\libboost_math_c99-vc120-mt-gd-1_59.lib\  等等

,这个我没发现,于是出现了问题。


希望各位要以此为鉴!!!


最后进行测试(此为网上找的代码,具体在哪里已经不清楚了,见谅),添加头文件
#include  //标准输入输出流
#include  //PCL的PCD格式文件的输入输出头文件
#include  //PCL对各种格式的点的支持头文件
#include //点云查看窗口头文件

然后在main函数中添加
{
 
  
	pcl::PointCloud::Ptr cloud(new pcl::PointCloud); // 创建点云(指针)
 
  
        if (pcl::io::loadPCDFile("F:\\rabbit.pcd", *cloud) == -1) //* 读入PCD格式的文件,如果文件不存在,返回-1
        {
            PCL_ERROR("Couldn't read file test_pcd.pcd \n"); //文件不存在时,返回错误,终止程序。
            return (-1);
        }
        pcl::visualization::CloudViewer viewer("Simple Cloud Viewer");//直接创造一个显示窗口
        viewer.showCloud(cloud);//再这个窗口显示点云
        while (!viewer.wasStopped())
        {
        }
        return (0);
}
运行,可以显示pcd文件,如图。
 
  
 
  
 
  
 
  





 
 

你可能感兴趣的:(Qt)