Article View: gnu.gcc.help
Article #42862DJGPP: using the C++ library
From: Alex Schroeder
Date: Tue, 31 Oct 1995 00:00
Date: Tue, 31 Oct 1995 00:00
49 lines
1932 bytes
1932 bytes
I tried to use the String-class supplied in GLP, but I always get
linking errrors. I suspect the error lies in the libraries beeing
linked with the -l option. Could somebody please explain to me which
libraries to use? I can compile the program to an object file with
-c. I am running under DOS 6.0, on a 486/33, and use DJ's GCC 2.6.3
Here is my test program:
--- test.cc:
#include <iostream.h>
#include <_string.h>
main ()
{
String a = "Hello!";
cout << a;
}
--- I compiled with:
gcc test.cc -liostr -lgpp -lgpl
--- and these where the error messages:
String.cc(.text+0x1967): undefined reference to `lib_error_handler'
String.cc(.text+0x1a25): undefined reference to `lib_error_handler'
String.cc(.text+0x1ae1): undefined reference to `lib_error_handler'
String.cc(.text+0x1b3b): undefined reference to `lib_error_handler'
String.cc(.text+0x1c45): undefined reference to `lib_error_handler'
String.cc(.text+0x1d75): more undefined references to `lib_error_handler' follow
--- if I compile without -lgpp (I just tried both since I wasn't sure
about which libraries to use):
gcc test.cc -liostr -lgpl
--- I get:
test.cc(.text+0x2b): undefined reference to `String::String(char const *)'
test.cc(.text+0x3c): undefined reference to `operator<<(ostream &, String const &)'
test.cc(.text+0x4a): undefined reference to `String::~String(void)'
--- any ideas why?
--
Grofzg! Mofzg! NagaNnaga! NnnaAARGHGAA! Agha! Naganahhagga!
PGP public key available on request from alex@zool.unizh.ch
Technical Details
Message-ID:
<475ipq$dnr@rzunews.unizh.ch>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,f5bef7aa5a51cd32,start X-Google-Attributes: gid11318c,public From: alex@zool.unizh.ch (Alex Schroeder) Subject: DJGPP: using the C++ library Date: 1995/10/31 Message-ID: <475ipq$dnr@rzunews.unizh.ch> X-Deja-AN: 118303493 organization: University of Zurich, Switzerland newsgroups: gnu.gcc.help