This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc problem


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]