www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/06/12:16:17

From: fredex AT fcshome DOT stoneham DOT ma DOT us
Message-Id: <199606061029.GAA00639@fcshome.stoneham.ma.us>
Subject: Re: Little problem with compiling
To: mistryc AT ecf DOT toronto DOT edu (MISTRY CHETAN)
Date: Thu, 6 Jun 1996 06:29:23 -0400 (EDT)
Cc: djgpp AT delorie DOT com
In-Reply-To: <Pine.SOL.3.91.960605124020.24077A-100000@spark22.ecf> from "MISTRY CHETAN" at Jun 5, 96 04:47:08 pm

Thinking furiously, MISTRY  CHETAN wrote:
> 
> I have a program which uses a few math functions from the include file, 
> and I have the line "#include <math.h>" in my code, and I compile it with 
> the command "gcc -lm progname.c" ;  but I still get an error message 
> something like undefined reference to "pow" (the function I'm using).
> 

Try changing:

	gcc -lm progname.c

to: 

	gcc progname.c -lm

BTW, a 15-line signature is WAY too big. For courtesy and following
internet suggested standards, you really ought to cut it down a bit.
(Of course, if you want to get picky, mine is too big, too! :-)

Fred
-- 
-------------------------------------------------------------------------------
 .----    Fred Smith    /                        Office: fred AT computrition DOT com 
( /__  ,__.   __   __ /  __   : /                                 508-663-2524 
 /    /  /   /__) /  /  /__) .+'           Home: fredex AT fcshome DOT stoneham DOT ma DOT us 
/    /  (__ (___ (__(_ (___ / :__                                 617-438-5471 
-------------------------------- Jude 1:24,25 ---------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019