ld
はリンクされたオブジェクトの依存性を自動的には検索しなくなります。
A
と B
の両方のライブラリを使用していた場合、 A
と B
の両方が明示的にリンクされない限りコンパイルを行いません。
/usr/bin/ld: gpx-parser.o: undefined reference to symbol 'acos@@GLIBC_2.0' /usr/bin/ld: note: 'acos@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
.o
をビルドした行は明示的に libm をリンクする必要があります。