delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/03/19:17:45

From: mimo AT gewi DOT kfunigraz DOT ac DOT at (mimo)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: linker problem w/ class String
Date: Sun, 03 May 1998 22:39:57 GMT
Organization: MimoLand
Lines: 48
Message-ID: <354cf0ff.2208086@news.kfunigraz.ac.at>
References: <354c562b DOT 14964878 AT news DOT kfunigraz DOT ac DOT at> <354B5E8A DOT 22F8 AT cs DOT com>
NNTP-Posting-Host: 143.50.169.19
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sat, 02 May 1998 13:57:30 -0400, "John M. Aldrich"
<fighteer AT cs DOT com> wrote:

hi john,

thanks for your quick reply

>mimo wrote:
>> 
>> Error: test.o: In function `__tcf_0':
>> Error: test.cc(.text+0x1f): undefined reference to
>> `String::~String(void)'
>> Error: test.o: In function `main':
>> Error: test.cc(.text+0x49): undefined reference to
>> `String::String(char const *)'
>> test.cc(2) Error: undefined reference to `operator<<(ostream &, String
>> const &)'
>
>That's very interesting.  No matter what I did, I was unable to
>reproduce your exact results, although I saw plenty of slightly
>different errors.  Perhaps it's because I'm using gcc 2.8.0 and you're
>still using 2.7.2.1.  In any case, the solution is simple:  you must

no, i m using version 2.80 (really! i m honest)

>link all required C++ libraries when you compile.  To use the String
>class, you have to link with both -lstdcxx and -lgpp.

i tried this too, since i followed your instructions in this
newsgroup, but the strange thing is, that nothing changed, besides
from sometimes getting even more errors :)

>
>You have two other problems in your code:  in order to use cout, you
>should #include <iostream.h> (even though it is included already by
><_string.h>), and void is not a legal return type for main().

i solved my problem somehow, i think its more or less a workaround
i included libgpp into my project and it links now, BTW i had the same
problem with the scitech grx library i remember. so i guess there s
some kind of bug in the relation between the linker and the archives
(this is really just a guess)

and i would really like to know how to solve it - just for fun! 
anyway, thanks for your help

mimo 

- Raw text -


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