I've been trying to get the Point Cloud Library working for a few days now. I've tried installing it several ways including cMake, MacPort and Home-brew. I've looked through many forums, blog posts and even Stack Overflow posts and I'm still stuck! The issue is that while there's nothing wrong with the program itself, upon compile I get an Undefined Symbols for Architecture X86_64 error. See below for direct quote:
Undefined symbols for architecture x86_64:
"pcl::console::print(pcl::console::VERBOSITY_LEVEL, char const*, ...)", referenced from:
int pcl::PCDWriter::writeBinary<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&) in main.o
int pcl::PCDWriter::writeASCII<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&, int) in main.o
"pcl::PCDWriter::writeASCII(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PCLPointCloud2 const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, int)", referenced from:
pcl::PCDWriter::write(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PCLPointCloud2 const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool) in main.o
"pcl::PCDWriter::writeBinary(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PCLPointCloud2 const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&)", referenced from:
pcl::PCDWriter::write(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PCLPointCloud2 const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Quaternion<float, 0> const&, bool) in main.o
"pcl::PCDWriter::setLockingPermissions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::interprocess::file_lock&)", referenced from:
int pcl::PCDWriter::writeBinary<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&) in main.o
int pcl::PCDWriter::writeASCII<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&, int) in main.o
"pcl::PCDWriter::resetLockingPermissions(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::interprocess::file_lock&)", referenced from:
int pcl::PCDWriter::writeBinary<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&) in main.o
int pcl::PCDWriter::writeASCII<pcl::PointXYZ>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, pcl::PointCloud<pcl::PointXYZ> const&, int) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like all the issues spring from the same type definition: PCDWriter. I checked the file it was in and the code looks fine to my unfamiliar eye. One post I saw suggested that the error means that the library was 32 bit trying to run on a 64 bit system. So I upgraded from PCL 1.6.0 to 1.8.1 (latest) in hopes of seeing a difference, but no change. Another suggested that it meant PCDwriter didn't hold the right information for the various bits of code that reference it. But again, the code looks fine as far as I can tell. I decided to try deliberately entering the path into the linker (don't ask why, desperation and unfamiliarity drive me to strange things) and while removing the 6 errors it replaced them with 1 saying "cannot specify -o when generating multiple output files". Which I found odd, having just my Main function at this point. According to another person this was due to problems encountered when header files are in the list of files to be compiled. The solution being to simply remove the headers from the list. So I removed them and returned to the error from before. I also tried, though unfamiliar with how xCode would interact with it, to use the "Use PCL in your own project" instructions on the Dev website. cMake refused to make.
I'm not very experienced with importing these types of libraries, mostly I've worked with Arduino before, though the OpenCV library was beautifully simple to install and get running (thanks Devs). Thank you for any help, I really appreciate it,
Sincerely, Noob