Re: ProC/C++ on Linux undefined reference error

From: Dave <David.W.Spencer_at_elcaro.moc>
Date: Wed, 16 Oct 2002 09:58:58 +0100
Message-ID: <3DAD2A52.3080809_at_elcaro.moc>


That isn't a precompile or compile error - it's a link error.

For some reason you're not linking with libc. This should happen by default; what happens if you try adding /usr/lib/libc.a to the link line?

If that doesn't make any difference try instead: extern "C" {
#include <string.h>
}
there is no extern "C" in my Suse 7 so perhaps the names are getting mangled.

Dave.

Julia Sennikovski wrote:
> Hello,
> When compiling the code (Linux 7.2, Oracle 8i, ProC/C++) I get the
> number of undefined references. The paths to libraries seem to be
> correct... And I do have <string.h> included...
> If you know what the problem may be, could you, please, help me solve
> it?
> Thank you,
> Julia.
>
>
> System default option values taken from:
> /usr/local/oracle/product/8.1.7/precomp/admin/pcscfg.cfg
>
> g++ -w -c -I. -I/usr/local/oracle/product/8.1.7/precomp/public
> -I/usr/local/oracle/product/8.1.7/rdbms/public
> -I/usr/local/oracle/product/8.1.7/rdbms/demo
> -I/usr/local/oracle/product/8.1.7/plsql/public
> -I/usr/local/oracle/product/8.1.7/network/public manreg.c
>
> g++ -o manreg manreg.o -L /usr/local/oracle/product/8.1.7/lib/
> -lclntsh `cat /usr/local/oracle/product/8.1.7/lib/sysliblist` -ldl
> -lm
>
> manreg.o: In function `fileLock::setFilename(basic_string<char,
> string_char_traits<char>, __default_alloc_template<true, 0> > const
> &)':
> manreg.o(.text+0x138): undefined reference to `strcpy(char *, char
> const *)'
> manreg.o(.text+0x14c): undefined reference to `strcat(char *, char
> const *)'
> .
> .
> more
> .
> .

-- 
Email address munged to avoid SPAM
Reverse the last two parts to reply directly
Received on Wed Oct 16 2002 - 10:58:58 CEST

Original text of this message