Issue #8 resolved

build fails on fedora-16 due to missing -lm

John Ellson
created an issue

Linking C executable copyrotated /usr/bin/ld: CMakeFiles/copyrotated.dir/copyrotated.o: undefined reference to symbol 'sin@@GLIBC_2.2.5' /usr/bin/ld: note: 'sin@@GLIBC_2.2.5' is defined in DSO /lib64/ so try adding it to the linker command line /lib64/ could not read symbols: Invalid operation collect2: ld returned 1 exit status make[2]: [examples/copyrotated] Error 1 make[1]: [examples/CMakeFiles/copyrotated.dir/all] Error 2 make: *** [all] Error 2

=========================== has tests for -lm - I guess copyrotated isn't using that?

Not sure thus is the right fix, but I was able to workaround with:


diff -r 733361a31aab examples/CMakeLists.txt --- a/examples/CMakeLists.txt Fri Jun 17 16:09:25 2011 +0900 +++ b/examples/CMakeLists.txt Fri Nov 04 15:25:20 2011 -0400 @@ -32,7 +32,7 @@

FOREACH(test_name ${TESTS_FILES}) add_executable(${test_name} "${test_name}.c") - target_link_libraries (${test_name} ${GD_LIB}) + target_link_libraries (${test_name} ${GD_LIB} -lm) ENDFOREACH(test_name)


Comments (2)

  1. Anonymous

    I ran into the same problem building on a LFS 7.1 system and can verify that John Ellson's patch allows gd to compile successfully.

  2. Log in to comment