This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc problem
Rick Roland <roland.rick@lgt.com> writes:
> Hi GCC team
>
> Compiling the very simple attached test.c using gcc generates the error
> message below, where g++ does not, what I do really not understand.
>
> $ gcc test.c
> Undefined first referenced
> symbol in file
> atan /var/tmp/cc2qkIFV.o
> ld: fatal: Symbol referencing errors. No output written to a.out
> collect2: ld returned 1 exit status
This is not a bug in GCC but in your usage of GCC.
You have to add -lm, atan is part of libm.
Btw. please don't send html enhanced emails,
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj