Article View: comp.os.linux.setup
Article #7problems with GCC
From: Chano GĂłmez MartĂnez
Date: Tue, 16 Apr 1996 21:52
Date: Tue, 16 Apr 1996 21:52
74 lines
3941 bytes
3941 bytes
First of all, I want to apologize for my awful English. Now, the C stuff : I'm trying to port a C program from Borland C++ 3.1 to GCC under Linux. My problem is that I can't use any function from math.h !!! The file is correctly #include'd ( in fact, I get no compilation errors ) but the linker always tells me something like : /tmp/cca000971.o(.text+0x39): undefined reference to `exp' The funny thing is that GPC ( the GNU Pascal compiler ) allows me to use math.h functions lihe exp(), sin(), fabs(), etc, but when I convert my Pascal programs to C with p2c and try to compile them with GCC , I get the same error again. Here is the result from compiling the Pascal source with GPC -v ... ================================================ Reading specs from /usr/lib/gcc-lib/i486-linux/2.6.3/specsgcc version 2.6.3 /usr/lib/gcc-lib/i486-linux/2.6.3/gpc-cpp -lang-pascal -v -nocharescape -undef -D__GNUC__=2 -D__GPC__=2 -D__GNUC_MINOR__=6 -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) -D__i486__ mat.p /tmp/cca00103.iGNU CPP version 2.6.3 (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /usr/local/include /usr/i486-linux/include /usr/lib/gcc-lib/i486-linux/2.6.3/include /usr/includeEnd of search list. /usr/lib/gcc-lib/i486-linux/2.6.3/gpc1 /tmp/cca00103.i -quiet -dumpbase mat.pas -version -o /tmp/cca00103.sGNU PASCAL version 2.6.3 (i386 Linux/ELF) compiled by GNU C version 2.6.3. /usr/i486-linux/bin/as -V -Qy -o /tmp/cca001031.o /tmp/cca00103.sGNU assembler version cygnus/linux-2.5.2l.15 (i486-linux), using BFD version cygnus/linux-2.5.2l.11 /usr/i486-linux/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/i486-linux/2.6.3 -L/usr/i486-linux/lib /tmp/cca001031.o -lgpc -lgcc -lm -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o ===================== and now the result from GCC : ============================= Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.0/specsgcc version 2.7.0 /usr/lib/gcc-lib/i486-linux/2.7.0/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) -D__i486__ mat.c /tmp/cca00097.iGNU CPP version 2.7.0 (i386 Linux/ELF)#include "..." search starts here:#include <...> search starts here: /usr/local/include /usr/i486-linux/include /usr/lib/gcc-lib/i486-linux/2.7.0/include /usr/includeEnd of search list. /usr/lib/gcc-lib/i486-linux/2.7.0/cc1 /tmp/cca00097.i -fno-strength-reduce -quiet -dumpbase mat.c -version -o /tmp/cca00097.sGNU C version 2.7.0 (i386 Linux/ELF) compiled by GNU C version 2.7.0. /usr/i486-linux/bin/as -V -Qy -o /tmp/cca000971.o /tmp/cca00097.sGNU assembler version cygnus/linux-2.5.2l.15 (i486-linux), using BFD version cygnus/linux-2.5.2l.11 /usr/i486-linux/bin/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/i486-linux/2.7.0 -L/usr/i486-linux/lib /tmp/cca000971.o -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o/tmp/cca000971.o(.text+0xf): undefined reference to `PASCAL_MAIN'/tmp/cca000971.o(.text+0x39): undefined reference to `exp' =========================== The only apparent difference between both results is in the libraries ( I think) Can anyone help me, please ??? Thanks in advance.
Technical Details
Message-ID:
<4l1and$iql@news.ran.es>Path:
arc1-ca.pugleaf.net!news.ran.es!usenetShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.ran.es!usenet From: chano@ran.es (Chano GĂłmez MartĂnez) Newsgroups: comp.os.linux.setup,comp.os.linux.misc,comp.os.linux,comp.lang.c,comp.lang.c++ Subject: problems with GCC Date: Tue, 16 Apr 1996 21:52:07 GMT Organization: RAN INTERNET Message-ID: <4l1and$iql@news.ran.es> NNTP-Posting-Host: pppv02.ran.es X-Newsreader: Forte Free Agent 1.0.82