Mail Archives: djgpp/2003/01/04/09:31:12
Hello.
Alex Vinokur wrote:
> I have some problem with basic_string.
> What is wrong ?
It seems that the DJGPP port of g++ should complain. I suspect you've found a
bug in the template code that was fixed in g++ > 3.1.
> ======================
> Windows 2000
> --------------------
> MinGW 2.0.0.-2
> GNU g++ version 3.2
> --------------------
> DJGPP 2.03
> GNU gpp version 3.1
> ======================
Have you tried gpp version 3.2 (or 3.2.1) for DJGPP?
> ========= C++ code : BEGIN =========
> // File t1.cpp
> #include <string>
> using namespace std;
>
> int main ()
> {
> basic_string<string> bs1;
> bs1 += "ABC";
>
> return 0;
> }
> ========= C++ code : END ===========
>
> ========= [ MinGW ] Compilation : BEGIN =========
>
> % g++ -W -Wall t1.cpp -o m.exe
>
> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccMBaaaa.o(.text$_ZNSbISsSt11char_traitsISsES
> aISsEE7replaceEN9__gnu_cxx17__normal_iteratorIPSsS2_EES6_jSs+0xcc):t1.cpp: undef
> ined reference to `std::char_traits<std::string>::assign(std::string*, unsigned,
> std::string)'
> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccMBaaaa.o(.text$_ZNSbISsSt11char_traitsISsES
> aISsEE4_Rep8_M_cloneERKS1_j+0xaa):t1.cpp: undefined reference to `std::char_trai
> ts<std::string>::copy(std::string*, std::string const*, unsigned)'
> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccMBaaaa.o(.text$_ZNSbISsSt11char_traitsISsES
> aISsEE9_M_mutateEjjj+0x15a):t1.cpp: undefined reference to `std::char_traits<std
> ::string>::copy(std::string*, std::string const*, unsigned)'
> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccMBaaaa.o(.text$_ZNSbISsSt11char_traitsISsES
> aISsEE9_M_mutateEjjj+0x191):t1.cpp: undefined reference to `std::char_traits<std
> ::string>::copy(std::string*, std::string const*, unsigned)'
> C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp/ccMBaaaa.o(.text$_ZNSbISsSt11char_traitsISsES
> aISsEE9_M_mutateEjjj+0x2ae):t1.cpp: undefined reference to `std::char_traits<std
> ::string>::move(std::string*, std::string const*, unsigned)'
>
> ========= [ MinGW ] Compilation : END ===========
>
> ========= [ DJGPP ] Compilation & Run : BEGIN =========
>
> % gpp -W -Wall t1.cpp -o d.exe // No errors
>
> % d.exe
>
> Exiting due to signal SIGSEGV
> General Protection Fault at eip=0001a0d4
> eax=ffffffff ebx=000426d0 ecx=2e6e6f67 edx=2e6e6f73 esi=00050a18 edi=00042664
> ebp=0058fe18 esp=0058fde0 program=C:\__TMP_0\D.EXE
> cs: sel=01a7 base=017c0000 limit=0058ffff
> ds: sel=01af base=017c0000 limit=0058ffff
> es: sel=01af base=017c0000 limit=0058ffff
> fs: sel=017f base=000056e0 limit=0000ffff
> gs: sel=01bf base=00000000 limit=0010ffff
> ss: sel=01af base=017c0000 limit=0058ffff
> App stack: [00590000..00510000] Exceptn stack: [000447b0..00042870]
>
> Call frame traceback EIPs:
> 0x0001a0d4
> 0x00018424
> 0x00017ecd
> 0x00017b5a
> 0x0001794b
> 0x0000163b
> 0x00004ee8
>
> ========= [ DJGPP ] Compilation & Run : END ===========
Try building with debug and then posting what symify shows:
symify C:\__TMP_0\D.EXE
You may need to use bfdsymify in of symify depending on which debug format you
use, which you can get by installing a distribution of gdb 5.
Please post the output of symify, when you get backtraces on segfaults. They
help a lot with debugging.
Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -