Compilation Ubuntu11.10上的Gosmore编译错误

Compilation Ubuntu11.10上的Gosmore编译错误,compilation,openstreetmap,mapnik,Compilation,Openstreetmap,Mapnik,我想在Ubuntu11.10服务器上编译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:(.

我想在Ubuntu11.10服务器上编译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

如何解决这个问题?

exp,atan,这些都在数学库中,它被称为libm.a,你用你做的-lm链接到它,但顺序错误:gcc-lm density.c-o density是错误的,gcc density.c-lm-o density是正确的

我可以用最新版本的gosmore重现您的问题,这是我的github副本中的一个补丁

不要忘记积极的反馈! 谢谢
迈克

谢谢你,迈克,我马上就去试试D