0

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 following 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?

lImbus
  • 1,578
  • 3
  • 14
  • 25
thetna
  • 6,903
  • 26
  • 79
  • 113

1 Answers1

3

You forgot to link against libm.

gcc ... -lm ...
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358