From: Richard Dawe Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,gnu.g++.help Subject: Re: Problem with basic_string Date: Sat, 04 Jan 2003 13:18:33 +0000 Lines: 101 Message-ID: <3E16DF29.5120A4FF@phekda.freeserve.co.uk> References: NNTP-Posting-Host: 62.136.92.124 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news5.svr.pol.co.uk 1041690326 9975 62.136.92.124 (4 Jan 2003 14:25:26 GMT) NNTP-Posting-Date: 4 Jan 2003 14:25:26 GMT X-Complaints-To: abuse AT theplanet DOT net X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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 > using namespace std; > > int main () > { > basic_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::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::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 ::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 ::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 ::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/ ]