2015-11-04 67 views
0

我試圖將我朋友的代碼加入到我的項目中。QT5.4.1中的PCL1.7.2 ---錯誤:PCL頭文件中的C2589,C2059,C2181

原始代碼高度使用PCL 1.7.2所以,

1.Installed PCL 1.7.2包(不與源代碼構建)

2.Edit INCLUDEPATH和myproject.pro文件LIBS ,根據我朋友在Visual Studio 2013中的設置(是的,他在VS2013下編寫了代碼)。例如 1 2 以及更多類似上述的路徑。

3.Include在mainwindow.h

#include <opencv2/opencv.hpp> 
#include <opencv2/imgproc/imgproc.hpp> 
#include <opencv/cv.h> 
#include <opencv/highgui.h> 

#include <boost/shared_ptr.hpp> 

#include <pcl/point_types.h> 
#include <pcl/point_cloud.h> 
#include <pcl/io/ply_io.h> 
#include <pcl/io/pcd_io.h> 

#include <pcl/kdtree/kdtree_flann.h> 
#include <pcl/surface/mls.h> 

#include <pcl/filters/statistical_outlier_removal.h> 
#include <pcl/filters/voxel_grid.h> 

#include <pcl/registration/icp.h> 
#include <pcl/filters/radius_outlier_removal.h> 

#include <pcl/features/normal_3d.h> 
#include <pcl/surface/gp3.h> 

#include <cv.h> 
#include <cxcore.h> 

using namespace cv; 
using namespace std; 
using namespace pcl; 

4.Build(編譯)項目,以及一堆錯誤的頭文件中出現了 3

的錯誤是C2589,C2059和C2181 ,基本上位於PCL頭文件中,如io_operators.h,pcl_io.h,correspondence.h,cloud_iterator.h。我完全不知道這些,這是否意味着我必須編輯PCL的頭文件?

回答

1

這些錯誤代碼都經常涉及到Windows的問題warning C4003 and errors C2589 and C2059 on: x = std::numeric_limits<int>::max();

確實存在io_operators.h:66pcl_io.h:281std::numeric_limits<>::max()

所以,如果它是它可以通過在頂部移動pcl頭以避免包括windows.h改變報頭的順序是固定的,唯一的問題之前或由全部夾雜物之前定義NOMINMAX(可從一些其它頭包括在內)。

+0

這對我來說是新的,我稍後再試,謝謝。 – APU