Opened 12 years ago
Closed 11 years ago
#4595 closed Bugs (invalid)
boost::lexical_cast throws std::bad_cast on OS X 10.6 when using _GLIBCXX_DEBUG
Reported by: | Owned by: | nasonov | |
---|---|---|---|
Milestone: | To Be Determined | Component: | lexical_cast |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: | antoshkka@… |
Description
I'm on Snow Leopard, using the default compiler i686-apple-darwin10-gcc-4.2.1
I compile the following test code with -D_GLIBCXX_DEBUG
unsigned int x = 3; std::string s = boost::lexical_cast<std::string>(x);
When executed, the program terminates with the output
terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast Abort trap
The code runs fine when _GLIBCXX_DEBUG is not defined
Change History (5)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
_GLIBCXX_DEBUG breaks ABI compatibility. If you use it, then Boost needs to be built with it too.
comment:3 by , 11 years ago
I still have this issue and I've built Boost with _GLIBCXX_DEBUG as well.
comment:4 by , 11 years ago
This appears to be a more likely cause: http://stackoverflow.com/questions/1416096/c-debug-builds-broke-in-snow-leopard-x-code
comment:5 by , 11 years ago
Cc: | added |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Thanks for the link - it explains the problem. It is not a bug of lexical_cast, it is a compiler/library bug.
Have you solved this error? I'm getting a similar error
In the error log I see:
Any help is greatly appreciated, Spinach