|
From: Des <Fre...@de...> - 2000-12-04 02:01:00
|
For some reason, any code which uses the C++ string class doesn't seem to
link properly under mingw32. It does compile, however, so am I neglecting
to link to something? Here's an example:
#include <string>
int main()
{
string s;
s="";
return 0;
}
Attempting to build this raises the following error:
C:\>gcc dodgy.cpp -o dodgy.exe
C:\WINDOWS\TEMP\cc1RxCfb.o(.text$_S_oom_malloc__t23__malloc_alloc_template1i
0Ui+
0x1a):dodgy.cpp: undefined reference to `endl(ostream &)'
C:\WINDOWS\TEMP\cc1RxCfb.o(.text$_S_oom_malloc__t23__malloc_alloc_template1i
0Ui+
0x27):dodgy.cpp: undefined reference to `cerr'
C:\WINDOWS\TEMP\cc1RxCfb.o(.text$_S_oom_malloc__t23__malloc_alloc_template1i
0Ui+
0x2c):dodgy.cpp: undefined reference to `ostream::operator<<(char const *)'
C:\WINDOWS\TEMP\cc1RxCfb.o(.text$replace__t12basic_string3ZcZt18string_char_
trai
ts1ZcZt24__default_alloc_template2b0i0UiUiPCcUi+0x31):dodgy.cpp: undefined
refer
ence to `__out_of_range(char const *)'
C:\WINDOWS\TEMP\cc1RxCfb.o(.text$replace__t12basic_string3ZcZt18string_char_
trai
ts1ZcZt24__default_alloc_template2b0i0UiUiPCcUi+0x8e):dodgy.cpp: undefined
refer
ence to `__length_error(char const *)'
I'm more used to building under DJGPP with RHIDE, so my guess is I've missed
something from the command line. Any ideas? Thanks in advance.
|