Page 1 of 1

Problem linking

Posted: Sat Dec 10, 2011 3:43 pm
by Maxxi
Linking C executable chipmunk_demos
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: ../src/libchipmunk.a(cpVect.c.o): undefined reference to symbol 'sincos@@GLIBC_2.2.5'
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: note: 'sincos@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
/lib64/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [Demo/chipmunk_demos] Error 1
make[1]: *** [Demo/CMakeFiles/chipmunk_demos.dir/all] Error 2
make: *** [all] Error 2


Any idea how to fix this?

Re: Problem linking

Posted: Sat Dec 10, 2011 6:35 pm
by slembcke
Like it says (very cryptically), it's not linking to the math library. Not sure why it wouldn't be by default like every other gcc setup. You'll have to add -lm to the linker options.