fcl
fcl copied to clipboard
Linker errors projecting down to libccd
Hi,
just a note in case anybody stumbles over the same thing that I did. I am working on the newest version out of this repository so I guess that this may be something which will be addressed in FCL soon, and just writing this for others who may be looking for a solution to the same or a similar linking problem.
I know there has been recent changes in migrating to having the precision (float or double) as template parameter. However in narrowphase/distance.cpp (and probably in other files, but that's the one which brought me onto it) there is only an implementation for double.
So when linking to libfcl.so and when using float precision in the code, there is weird linker errors. It projected back to libccd with undefined symbols/references in my case.
Great work on this library btw!
Cheers Jenny
Could you provide more details like the version of FCL and error messages?
Hi,
I am using the version from this repo master branch which I pulled about 2 weeks ago.
Meanwhile our code has changed a lot as I migrated it to another package, and now I can't reproduce the original error message... But I found it in one of my emails (we had the problem on several machines and exchanged the errors we got):
[ 83%] Linking CXX executable vizlib_fcl_example
/usr/bin/ld: CMakeFiles/vizlib_fcl_example.dir/src/example.cc.o: undefined reference to symbol 'ccd_vec3_origin'
//usr/lib/libccd.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
By the way, I also noticed that my initial thought that it was the not existing float implementation in distance.cpp was a wrong lead, because distance.h includes distance-inl.h already. I got this wrong idea because the error suddenly went away after I changed my typedef to double. Meanwhile after lots of re-compiles and package changes I can change it back to float and it works.... really one of the stranger things I have encountered.
Some other linker problems we had may have had to do with the libccd library which was linked. If there are two installed - one from ros indigo and another from the libccd-dev package - it prefers the indigo one (this is not compiling with catkin, but from a cmake-only project). So for compilation I removed the sourcing of the ros bash file from my .bashrc, that removed other linker errors and instead produced the error above.
Also notable is that in some of my attempts to address this, when find-packaging libccd separately in my CMakeLists, I got lots of other undefined references to Qt and other libraries. Though the cmake file itself was ok... it all goes through fine now with the same cmake file (though unfortunately I'm still not quite sure what exactly it was that fixed it in the end, I did many things along the way).
I will try to reproduce the exact error on another computer and then post it here.
I have a similar problem. Like @JenniferBuehler , I was able to eliminate many linking errors by switching all of my solver, geometry, vector, and quaternion template specifications from float to double. However, the following error still remains:
/usr/bin/ld: CMakeFiles/test_01_mrkr.dir/src/test_01_mrkr.cpp.o: undefined reference to symbol 'ccd_vec3_origin'
/usr/local/lib/libccd.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
geo_devel/CMakeFiles/test_01_mrkr.dir/build.make:170: recipe for target '/home/jwatson/asm_seq_plan_3d/devel/lib/geo_devel/test_01_mrkr' failed
make[2]: *** [/home/jwatson/asm_seq_plan_3d/devel/lib/geo_devel/test_01_mrkr] Error 1
CMakeFiles/Makefile2:528: recipe for target 'geo_devel/CMakeFiles/test_01_mrkr.dir/all' failed
make[1]: *** [geo_devel/CMakeFiles/test_01_mrkr.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
Ubuntu 16.04 ROS Kinetic FCL Version: 0.5.0-271-gf6a73c7 , Commit: f6a73c752cd5685f881ef25a1345511ca1f2408a libccd Version: v2.0-37-g64f02f7 , Commit: 64f02f741ac94fccd0fb660a5bffcbe6d01d9939
I should also add that I took care to remove the ROS version of FCL.
I was getting the same error but if you clone the libccd repository and build with double precisions the error goes away.