This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc problem
- To: Rick Roland <roland dot rick at lgt dot com>
- Subject: Re: gcc problem
- From: Erik Mouw <J dot A dot K dot Mouw at ITS dot TUDelft dot NL>
- Date: Mon, 9 Jul 2001 14:40:02 +0200
- Cc: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Organization: Eric Conspiracy Secret Labs
- References: <1ED217C194E8D311A5890060942F6CFE060A3E@scbexc01s.bilvdz.bil.com>
On Mon, Jul 09, 2001 at 02:23:29PM +0200, Rick Roland wrote:
> 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
>
> Here my LD_LIBRARY_PATH and PATH:
>
> $ echo $LD_LIBRARY_PATH
> /usr/local/lib:/usr/lib/:/usr/dt/lib:/usr/openwin/lib:/usr/ucblib:/opt/gnu/l
> ib:/opt/SUNWspro/lib:/usr/
> local/include
>
> $ echo $PATH
> /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/ucb:/usr/openwin/bin:/usr/
> dt/bin:/opt/SUNWspro/bin:/
> usr/ccs/bin:/opt/SUNWfw/clients/bin:.:/opt/netscape:/opt/appl/bin
>
> Quite interessting: The gcc compiles the attached bonnie.c without any
> errors or warnings.
>
> Please can you help, explain or give any hint?
Link with the math library, so use "gcc test.c -lm". G++ links with -lm
by default.
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/