gcc compile problem ...
Brian J. Dent
briandent@redshift.com
Wed Jan 26 06:51:00 GMT 2000
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/
More information about the Gcc-help
mailing list