Error during linking of examples
3zuli opened this issue · 2 comments
3zuli commented
Hello, I am trying to compile cupoch version 0.1.9.1 on Ubuntu 18. Since Ubuntu comes with CMake 3.10.2, I downloaded the cmake 3.20.2 binary. Below are my build steps. The build works most of the way, but it crashes when it tries to link the executables in examples
.
git clone https://github.com/neka-nat/cupoch.git --branch v0.1.9.1 --recurse
cd cupoch
mkdir -p build; cd build;
~/Downloads/cmake-3.20.2-linux-x86_64/bin/cmake ..
make -j4
...
[ 96%] Linking CXX executable ../../bin/examples/registration
/usr/bin/ld: //usr/local/lib/libglfw3.a(x11_window.c.o): undefined reference to symbol 'XConvertSelection'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
examples/cpp/CMakeFiles/registration.dir/build.make:129: recipe for target 'bin/examples/registration' failed
make[2]: *** [bin/examples/registration] Error 1
CMakeFiles/Makefile2:1732: recipe for target 'examples/cpp/CMakeFiles/registration.dir/all' failed
make[1]: *** [examples/cpp/CMakeFiles/registration.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2
Googling these errors suggests that the libraries are not being linked in the correct order, but so far I was unable to fix this. I also tried several previous cupoch releases but I got the exact same error.
neka-nat commented
Hi,
Thank you for the reporting!
How about using the package's glfw instead of the environment's glfw?
cmake .. -DBUILD_GLEW=ON -DBUILD_GLFW=ON
3zuli commented
Yes, thank you! With this I was able to compile everything.