Similar question has been asked here but is unanswered.
I have an implementation of Levenberg-Marquardt
(downloaded from somewhere) and I'm trying to compile it but getting the following error.
gauravloj@vertex:~/Documents/source_code/non-rigid_registration/Gauss_newton/levmar-2.6$ make
[ 87%] Built target levmar
Linking C executable lmdemo
/usr/bin/ld: CMakeFiles/lmdemo.dir/lmdemo.c.o: undefined reference to symbol 'exp@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [lmdemo] Error 1
make[1]: *** [CMakeFiles/lmdemo.dir/all] Error 2
make: *** [all] Error 2
At many sites, the solution given was to add some flags (e.g here and here). But none of them worked for me.
Here is the Makefile, here is the CMakeLists.txt and here is the CMakeCache.txt.
ldd --version
gave(Ubuntu EGLIBC 2.19-0ubuntu6.3) 2.19
.-lm
? Where did you add it?