开发者

Getting following error "collect2: ld returned 1 exit status"

I have created a C source file using the modules from other source files. Suppose the created source file is abc.c .Mine C file compiles fine using the following command.

gcc -c  abc.c 

I have compiled each and every source file that are linked to the abc.c .While creating the executable file using the follo开发者_如何学Cwing command:

 gcc abc.o b.o c.o ....strings.o -o abc

It shows the following error, although i have used strings.o for creating executable file:

strings.o: In function `string_IntToString':
strings.c:(.text+0x5d3): undefined reference to `log10'
strings.c:(.text+0x606): undefined reference to `log10'
collect2: ld returned 1 exit status

Could you suggest me what can be the wrong here?


You forgot to link against libm.

gcc ... -lm ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜