#1 problem with cJSON on Ubuntu 10.04 and gcc 4.4.3

closed-invalid
nobody
None
5
2011-03-07
2011-03-05
rcbandit
No

Hi,
I tryed to compile cJSON.c on Ubuntu 10.04 and gcc 4.4.3 but this error came on.

/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/ccu74jMy.o: In function `parse_number':
cJSON.c:(.text+0x3b3): undefined reference to `pow'
/tmp/ccu74jMy.o: In function `print_number':
cJSON.c:(.text+0x4b9): undefined reference to `floor'
collect2: ld returned 1 exit status

Any idea where is the problem?

Discussion

  • Dave Gamble

    Dave Gamble - 2011-03-07
    • status: open --> closed-invalid
     
  • Dave Gamble

    Dave Gamble - 2011-03-07

    You're missing -lm in your gcc command.

     

Log in to post a comment.