public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Brian J. Dent" <briandent@redshift.com>
To: help-gcc@gnu.org
Subject: gcc compile problem ...
Date: Wed, 26 Jan 2000 06:51:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20000126064259.00a8a330@redshift.com> (raw)

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/

WARNING: multiple messages have this Message-ID
From: "Brian J. Dent" <briandent@redshift.com>
To: help-gcc@gnu.org
Subject: gcc compile problem ...
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20000126064259.00a8a330@redshift.com> (raw)
Message-ID: <20000401000000.x9DL8aFMxXtq37h1GTosLVOVYTUOwAaqevKPV7m8jdM@z> (raw)

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/

             reply	other threads:[~2000-01-26  6:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-26  6:51 Brian J. Dent [this message]
2000-01-26 12:10 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` Brian J. Dent
2002-09-27  9:09 GCC " gcc
2002-09-27  9:30 ` Sebastian Huber
2002-09-27  9:35 ` John Love-Jensen
2002-09-27 15:52   ` Sebastian Huber
2002-09-30  4:49     ` John Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4.2.0.58.20000126064259.00a8a330@redshift.com \
    --to=briandent@redshift.com \
    --cc=help-gcc@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).