Article View: gnu.gcc.help
Article #41932GCC won't Link with Math functions
From: Kelly Edwards
Date: Fri, 02 Feb 1996 00:00
Date: Fri, 02 Feb 1996 00:00
22 lines
1143 bytes
1143 bytes
I am using gcc running under the Slackware version 2.2.0 of Linux. I have been attempting to compile and link a c program which includes several math functions such as cos, floor, pow, etc. I keep getting undefined reference to cos (etc) messages. Specifics include: - I am compiling using gcc -g -lm -o output_name name.c - I have included #include <math.h> - I even tried using -I and -L options to include the directories for math.h and libm.a - program compiles OK with the -c option. - This program compiles OK on an IBM RS6000. Am I missing something obvious, or is the compiler not linking the libm.a library as it should? I would appreciate any help provided. Thanks. Kelly Edwards Midland, TX email 74127.3014@compuserve.com
Technical Details
Message-ID:
<4etf9j$c75$1@mhafc.production.compuserve.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,c8c72a5da0bb27a7,start X-Google-Attributes: gid11318c,public From: Kelly Edwards <74127.3014@CompuServe.COM> Subject: GCC won't Link with Math functions Date: 1996/02/02 Message-ID: <4etf9j$c75$1@mhafc.production.compuserve.com> X-Deja-AN: 137756168 organization: Chevron newsgroups: gnu.gcc.help