This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
gcc compile problem ...
- To: help-gcc at gnu dot org
- Subject: gcc compile problem ...
- From: "Brian J. Dent" <briandent at redshift dot com>
- Date: Wed, 26 Jan 2000 06:50:31 -0800
gcc help,
Obviously I am new to the GNU gcc compiler.
I've been trying compile a program on our SUN with gcc
(sparc-sun-solaris2.7/2.95.1) and it contains some intrinsic
functions. When I get to the point of linking it doesn't recognize the
functions, eg: sqrt. Below is a test program. What is missing that I am
not finding the built-in functions to link with? Thanks for any help.
file:marc.c:
#include <stdio.h>
#include <math.h>
main()
{
double x = 2;
printf("sqrt of %d is %f\n",x,sqrt(x));
}
gcc -c marc.c
gcc -o marc.out marc.o
Undefined first referenced
symbol in file
sqrt marc.o
ld: fatal: Symbol referencing errors. No output written to marc.out
collect2: ld returned 1 exit status
- bjd
____________________________
Brian J. Dent
CompuDent
v (831) 649-0948 f (707) 222-1209
http://www.redshift.com/~briandent/