Archived

This topic is now archived and is closed to further replies.

billybob

std::string::size or length ARRRGGGH

Recommended Posts

i'm getting a crash in std::string::size or std::string::length NO MATTER WHAT I DO. every single freaking time crash and asks for strlen.asm. THIS crashes:
int main(int argc, char ** argv)
{
 std::string test("lala");
 printf("%d", test.length());
 return 0;
}
  
so is it just a worthless piece of crap (sure seems like it) or what am i doing wrong. [edited by - billybob on March 17, 2003 3:51:18 AM]

Share this post


Link to post
Share on other sites
hmmmmmm. Tricky problem. Step down through the stack trace into the frame that calls strlen, and find out whether the arguments it''s passing in are valid.


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
msvc++ 6, don''t know what STL version it is. i know it should be fine but no matter what i do it never works. i''ve tried strlen("lala") and it works perfectly, so i have no idea why this doesn''t work.

Share this post


Link to post
Share on other sites
Downloading STLPort would be a avoiding rather than solving the problem, but it might be your easiest way out.

Have you done any messing around with library linking? (Debug versus Release, Single-Threaded versus Multithreaded)


How appropriate. You fight like a cow.

Share this post


Link to post
Share on other sites
Make sure you have all the MSVC STL fixes (see my signature) before proceeding, or download STLPort. You might even have a corrupt install somewhere.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
bah it worked, i wasted SOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO MUCH TIME on that.

edit: STL port did.

[edited by - billybob on March 17, 2003 7:21:27 AM]

Share this post


Link to post
Share on other sites