0

ubuntu 11.10 サーバーで Gosmore をコンパイルしたい。

からソースコードを入手しました:

http://svn.openstreetmap.org/applications/rendering/gosmore/

コマンド「make」コマンドを試すと、次のようなエラーが発生しました。

gcc -lm density.c -o density
/tmp/ccNQSatu.o: In function `main':
density.c:(.text+0x21f): undefined reference to `exp'
density.c:(.text+0x224): undefined reference to `atan'
density.c:(.text+0x2c3): undefined reference to `exp'
density.c:(.text+0x2c8): undefined reference to `atan'
density.c:(.text+0x5d3): undefined reference to `exp'
density.c:(.text+0x5d8): undefined reference to `atan'
density.c:(.text+0x67a): undefined reference to `exp'
density.c:(.text+0x67f): undefined reference to `atan'
density.c:(.text+0x723): undefined reference to `exp'
density.c:(.text+0x728): undefined reference to `atan'
density.c:(.text+0x793): undefined reference to `exp'
density.c:(.text+0x798): undefined reference to `atan'
collect2: ld returned 1 exit status
make: *** [jni/bboxes.c] Error 1

これを解決するには?

4

1 に答える 1

1

exp、atan、これらは数学ライブラリにあり、 libm.a と呼ばれ、 -lm でリンクしますが、順序が間違っています: gcc -lmdensity.c -odensity is wrong, gccdensity .c -lm -o 密度は正しいです。

gosmore の最新バージョンで問題を再現できます。github のコピーにパッチがあります。

https://github.com/h4ck3rm1k3/gosmore/commit/67bd8e2dd7e76de47a31b3c3df1ab33b8fda797b

肯定的なフィードバックを忘れないでください! ありがとうマイク

于 2012-04-18T21:57:33.777 に答える