Re: log - undefined symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Mittwoch, 8. März 2006 00:51 schrieb Vijay Gandhi:
> Hello,
>
> I tried compiling a C file using gcc 4.0.0 on SunOS5.8. This file includes
> math.h there is a call on log() in its code. When I compile this C file, I
> get a "undefined symbol referenced error. ld returned 1 exit status."
>
> Any idea how this could be fixed?
>

Try to add -lm to your linker flags:

	gcc -lm file.c -o executable

or

	gcc file.c -c -o file.o
	gcc -lm file.o -o executable

bye ingo


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux