2011-12-27 110 views
0

我想在Ubuntu 11.10服務器上編譯Gosmore。Gosmore在Ubuntu 11.10編譯錯誤

我從源代碼:

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 

如何解決這個問題?

回答

1

exp,atan,這些在數學庫中,它被稱爲libm.a,你用-lm鏈接到它,但是按照錯誤的順序:gcc -lm density.c -o density is錯誤的,海灣合作委員會密度。-lm -o密度是正確的。

我能夠用最新版本的gosmore重現您的問題,這裏是我的github副本中的補丁。

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

不要忘記了積極的反饋! 謝謝 麥克

+0

謝謝麥克,我會盡快嘗試。 :d – 2012-04-20 07:19:27