Missing linked libraries
The current build is missing the m
and pthread
libraries when linking and some tools complain about missing symbols (this comes from a warning in Debian build).
$ ldd -r build/libpillowfight.so
linux-vdso.so.1 (0x00007ffd58b98000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fef4b150000)
/lib64/ld-linux-x86-64.so.2 (0x00007fef4b35d000)
undefined symbol: atan2 (build/libpillowfight.so)
undefined symbol: fmod (build/libpillowfight.so)
undefined symbol: hypot (build/libpillowfight.so)
undefined symbol: exp (build/libpillowfight.so)
undefined symbol: pthread_join (build/libpillowfight.so)
undefined symbol: pthread_create (build/libpillowfight.so)
undefined symbol: round (build/libpillowfight.so)
undefined symbol: sqrt (build/libpillowfight.so)
The fix is to add target_link_libraries(pillowfight -lm -lpthread)
after add_library
in CMakeLists.txt
.
After doing that:
ldd -r build/libpillowfight.so
linux-vdso.so.1 (0x00007ffeeb769000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3047ca2000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3047c81000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3047ac1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3047e34000)
I'm not sure about possible side effect on other OS.