Mail Archives: djgpp/1998/11/25/05:31:02
Hi Michael and all you others!
I thought this was a simple problem: Just link with libgpp and that's it.
So I compiled Michael's program with my usual commandline and it did compile
without errors or warnings. However, I tried to break the commandline down to
the necessary arguments and I typed:
gxx TEST.cc -lgpp
But this resulted in:
f:/cccqcctf(.text+0x1e):TEST.cc: undefined reference to
`String::operator=(char const *)'
f:/cccqcctf(.text+0x6b):TEST.cc: undefined reference to String::~String(void)'
f:/cccqcctf(.text+0x8a):TEST.cc: undefined reference to `String::String(char
const *)'
So I got back to my original call to gxx and found out that I had to compile
it with some optimizations to make it work:
So
gxx test.cc -lgpp -O
will work.
What is going on here?
Manni Heumann,
Bielefeld, Germany
>Michael Schuster wrote:
>>
>> Hi everyone!
>>
>> I'm desperately searching for a bug in my new 2.8.1 djgpp
>> installation, but cannot find it.
>>
>> The problem I face is the damn old String class problem which I posted
>> already 2 times.
>> As I want to know, if I do something wrong, I ask you if someone with
>> a 2.8.1 can compile the following little c++ code (which I cnly can
>> compile with my 2.7.xx djgpp?
>>
>> #include <iostream.h>
>> #include <string.h>
>> #include <_String.h>
>>
>> String xc="test2";
>> char d[25]="dummy";
>>
>> int main()
>> {
>> xc=d;
>> strcpy(d,xc);
>> cout<<d;
>> }
>
- Raw text -