Question

I am trying to use the Point Cloud Library in conjunction with the kinect for a paper, but when I followed this tutorial, and tried to compile the solution in Visual Studio 2010, I had a couple of build errors:

pcd_write.obj : error LNK2019: unresolved external symbol "public: int __thiscall pcl::PCDWriter::writeASCII(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,int)" (?writeASCII@PCDWriter@pcl@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABUPointCloud2@sensor_msgs@@ABV?$Matrix@M$03$00$0A@$03$00@Eigen@@ABV?$Quaternion@M$0A@@8@H@Z) referenced in function "public: virtual int __thiscall pcl::PCDWriter::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,bool)" (?write@PCDWriter@pcl@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABUPointCloud2@sensor_msgs@@ABV?$Matrix@M$03$00$0A@$03$00@Eigen@@ABV?$Quaternion@M$0A@@8@_N@Z)
pcd_write.obj : error LNK2019: unresolved external symbol "public: int __thiscall pcl::PCDWriter::writeBinary(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &)" (?writeBinary@PCDWriter@pcl@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABUPointCloud2@sensor_msgs@@ABV?$Matrix@M$03$00$0A@$03$00@Eigen@@ABV?$Quaternion@M$0A@@8@@Z) referenced in function "public: virtual int __thiscall pcl::PCDWriter::write(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,struct sensor_msgs::PointCloud2 const &,class Eigen::Matrix<float,4,1,0,4,1> const &,class Eigen::Quaternion<float,0> const &,bool)" (?write@PCDWriter@pcl@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABUPointCloud2@sensor_msgs@@ABV?$Matrix@M$03$00$0A@$03$00@Eigen@@ABV?$Quaternion@M$0A@@8@_N@Z)
pcd_write.obj : error LNK2019: unresolved external symbol "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@YAXW4VERBOSITY_LEVEL@12@PBDZZ) referenced in function "public: int __thiscall pcl::PCDWriter::writeASCII<struct pcl::PointXYZ>(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class pcl::PointCloud<struct pcl::PointXYZ> const &,int)" (??$writeASCII@UPointXYZ@pcl@@@PCDWriter@pcl@@QAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$PointCloud@UPointXYZ@pcl@@@1@H@Z)

Can someone explain why these errors are occurring and how I can fix them? All help is greatly appreciated and I always accept an answer!

Was it helpful?

Solution

You are probably using the wrong PCL version (64 bit / 32 bit). If you are generating a 64 bit CMake project, be sure to install 64bit PCL libraries for Visual Studio 2010. If you are unsure about the version of PCL being used, you can check by following the suggestion from Fraser.

You can download the correct PCL libraries from here.

OTHER TIPS

I was having this same error and I found the solution to it. When you are using cmake, make sure you choose the Visual Studio 10 win64 generators if you are using the 64 bit PCL libraries. I originally used the Visual Studio 10 generators and got the exact same error. When I switched it to Visual Studio 10 win64 generators it worked like a charm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top