I'm using a CamBoard Nano and Point Cloud Library in a C++ program. It uses a couple other libraries and one main C++ function as of right now. Someone else wrote the code for Windows, and I'm porting it over to Linux (Ubuntu 12.04). I've been able to get the C++ file to compile with a Makefile, but now I'm getting a ton of errors from the object file. I'm new to C++, and I don't understand what they all mean. It looks like they all stem from the same issue, hopefully one change will fix everything.
I was able to work out the errors in the C++ file by installing some Libraries (PCL, VTK, Eigen, OpenNI, etc.). I'll post what I can of the errors below, they fill up more than the entire terminal. I did look around on Google, and I found this: Qt 4.7 + VTK 5.6.1 on Mac OS X 10.6: errors linking projects
I downloaded QT 5.3, but when I use cmake on the example program I get the following error:
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:20 (message):
VTK was not built with Qt
-- Configuring incomplete, errors occurred!
I'm trying to fix this now. I'll post my Makefile and errors below, so if anyone knows how to fix this or has advice, please let me know. Thanks!
Makefile:
CC = g++-4.4
CFLAGS = -I ../include -I ~/../../usr/include/pcl-1.7/ -I ~/../../usr/include/eigen3/Eigen/src -I ~/../../usr/include/vtk-5.8
# first location: pmd header files (include, back one directory)
# second location: your pcl header files
# third location: your eigen header files
# fourth location: your vtk header files
LDFLAGS = -L. -lpmdaccess2 -lc
all: main
main: main.cpp copysdk copyplugins
$(CC) $(CFLAGS) -c -o main.o main.cpp
$(CC) $(LDFLAGS) -o main main.o
copysdk:
cp ../bin/libpmdaccess* ./ # bin folder back one directory
copyplugins:
cp ../bin/camboardnano* ./
clean:
rm main
rm main.o
rm camboardnano*
rm libpmdaccess*
Example of Errors:
main.o: In function `bool pcl::visualization::PCLVisualizer::addArrow<pcl::PointXYZ, pcl::PointXYZ>(pcl::PointXYZ const&, pcl::PointXYZ const&, double, double, double, double, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
main.cpp:(.text._ZN3pcl13visualization13PCLVisualizer8addArrowINS_8PointXYZES3_EEbRKT_RKT0_ddddddRKSsi[bool pcl::visualization::PCLVisualizer::addArrow<pcl::PointXYZ, pcl::PointXYZ>(pcl::PointXYZ const&, pcl::PointXYZ const&, double, double, double, double, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0xcc): undefined reference to `pcl::console::print(pcl::console::VERBOSITY_LEVEL, char const*, ...)'
main.cpp:(.text._ZN3pcl13visualization13PCLVisualizer8addArrowINS_8PointXYZES3_EEbRKT_RKT0_ddddddRKSsi[bool pcl::visualization::PCLVisualizer::addArrow<pcl::PointXYZ, pcl::PointXYZ>(pcl::PointXYZ const&, pcl::PointXYZ const&, double, double, double, double, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0x22d): undefined reference to `vtkActor2D::GetProperty()'
main.cpp:(.text._ZN3pcl13visualization13PCLVisualizer8addArrowINS_8PointXYZES3_EEbRKT_RKT0_ddddddRKSsi[bool pcl::visualization::PCLVisualizer::addArrow<pcl::PointXYZ, pcl::PointXYZ>(pcl::PointXYZ const&, pcl::PointXYZ const&, double, double, double, double, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0x279): undefined reference to `pcl::visualization::PCLVisualizer::addActorToRenderer(vtkSmartPointer<vtkProp> const&, int)'
main.o: In function `bool pcl::visualization::PCLVisualizer::addPointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)':
main.cpp:(.text._ZN3pcl13visualization13PCLVisualizer13addPointCloudINS_8PointXYZEEEbRKNS_10PointCloudIT_E8ConstPtrERKNS0_25PointCloudGeometryHandlerIS5_EERKSsi[bool pcl::visualization::PCLVisualizer::addPointCloud<pcl::PointXYZ>(pcl::PointCloud<pcl::PointXYZ>::ConstPtr const&, pcl::visualization::PointCloudGeometryHandler<pcl::PointXYZ> const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)]+0x84): undefined reference to `pcl::console::print(pcl::console::VERBOSITY_LEVEL, char const*, ...)'
main.o: In function `vtkSmartPointer<vtkDataSet>::~vtkSmartPointer()':
These aren't all the errors, but all the errors that would fit in the terminal can be found here:
One of the things I noticed is that vtkSmartPointer came up a lot. I think that was the first header file that I was notified about when I was trying to compile the C++ code without the VTK library. Don't know if that means anything.