Mail Archives: djgpp/1998/04/28/17:47:36
I think I may have identified the problem. I don't think any C++ programs
compile. I tried to compile something with the vector class and that gave me
the same kind o ferrors. Any ideas? I noticed that I do not have gxx. I have
gpp, and i'm not sure what the difference is. I know i downloaded everything
and unzipped correctly, or so i thought. any other ideas?
Here is the stuff you requested. Here is my test program
#include <iostream.h>
#include <string.h>
int main()
{
string word = "test";
cout << test << endl;
return 0;
}
Keep in mind that I have messed around with the details of this
implementation, such as changing #include <string.h> to #include <_string.h>
and chaging "string" to "String" and stuff like that as was suggested. Here
is the results of redirecting the compile information to a file...
c:/djgpp/tmp/ccaaaaaa1.o(.text+0x24):test.cpp: undefined reference to
`String::String(char const *)'
c:/djgpp/tmp/ccaaaaaa1.o(.text+0x3c):test.cpp: undefined reference to
`operator<<(ostream &, String const &)'
c:/djgpp/tmp/ccaaaaaa1.o(.text+0x57):test.cpp: undefined reference to
`String::~String(void)'
c:/djgpp/tmp/ccaaaaaa1.o(.text+0x7b):test.cpp: undefined reference to
`String::~String(void)'
And to answer these questions....
> 1) Can you compile C programs?
Yes.
> 2) Can you compile C++ programs that use other headers besides
> _string.h?
Now that I check, no.
> 3) Can you compile from DOS?
Yes
> 4) If you get undefined references, are you linking the C++ libraries
> when you compile (RHIDE should do this automatically)?
I compiled with RHIDE, and that didn't happen
> 5) Are you spelling #include correctly? (Don't laugh; somebody did this
> earlier.)
Yessir
> 6) Have you made any changes to your 'djgpp.env'?
Nope
- Raw text -