Gosmore 在 ubuntu 11.10 上编译错误
我想在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
如何解决这个问题?
I want to compile Gosmore on ubuntu 11.10 server.
I got source code from :
http://svn.openstreetmap.org/applications/rendering/gosmore/
When i try command "make" command i got error like below:
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
how to solve this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
exp,atan,这些位于数学库中,称为 libm.a ,您使用 -lm 链接到它,但顺序错误: gcc -lm Density.c -o Density 是错误的,GCC Density .c -lm -o 密度正确。
我可以使用最新版本的 gosmore 重现您的问题,这是我的 github 副本中的补丁。
https://github.com/h4ck3rm1k3/gosmore/commit/67bd8e2dd7e76de47a31b3c3df1ab33b8fda797b
不要忘记积极的反馈!
谢谢
麦克风
exp, atan, these are in the math lib, it is called libm.a , you link to it with -lm which you did to, but in the wrong order : gcc -lm density.c -o density is wrong, gcc density.c -lm -o density is correct.
I am able to reproduce your problem with the latest version of gosmore, here is a patch in my copy of github.
https://github.com/h4ck3rm1k3/gosmore/commit/67bd8e2dd7e76de47a31b3c3df1ab33b8fda797b
dont forget a positive feedback!
thanks
mike