0

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 ?

1 Answer 1

1

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

1
  • Thanks Mike, i'll try it soon. :D Commented Apr 20, 2012 at 7:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.