Reputation: 239
I tried to include my friend's code into my project.
The original code highly uses PCL 1.7.2 so I,
1.Installed PCL 1.7.2 package(not built with source code)
2.Edit INCLUDEPATH and LIBS in myproject.pro file, according to my friend's settings in Visual Studio 2013(yes, he wrote the code under VS2013). e.g
and more lines of path like above.
3.Include the header file in 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(Compile) the project, and bunch of errors showed up
The errors are C2589, C2059 and C2181, basically lie in PCL headers like io_operators.h, pcl_io.h, correspondence.h, cloud_iterator.h. I have totally no clue of these, does this means I have to edit PCL's header files?
Upvotes: 1
Views: 681
Reputation: 6776
Those error codes are quite often related to the Windows issue warning C4003 and errors C2589 and C2059 on: x = std::numeric_limits<int>::max();
Indeed there is std::numeric_limits<>::max()
in io_operators.h:66
and pcl_io.h:281
.
So, if it is the only problem it can be fixed by changing order of headers by moving pcl
headers on top to avoid including windows.h
(that may be included from some other header) before or by defining NOMINMAX
before all inclusions.
Upvotes: 2