|
Boost : |
Subject: [boost] Problem with debug Boost, Mac OS X and g++ 4.6
From: John Wiegley (johnw_at_[hidden])
Date: 2011-03-30 18:48:09
I'm not sure yet whether this is a Boost issue, or a g++ 4.6 issue. I've
compiled Boost 1.46.1 on Mac OS X using g++ 4.6 and these build options:
sh bootstrap.sh && ./bjam debug \
--toolset=darwin --build-type=complete --layout=versioned \
define=_GLIBCXX_FULLY_DYNAMIC_STRING=1 define=_GLIBCXX_DEBUG=1 \
install
Then I build and execute the following example code:
#include <boost/regex.hpp>
#include <string>
int main(int argc, char *argv[]) {
boost::regex expr("foo.*bar");
return boost::regex_search(std::string(argv[1]), expr) ? 0 : 1;
}
with this compile/link command:
g++-mp-4.6 -D_GLIBCXX_FULLY_DYNAMIC_STRING=1 -D_GLIBCXX_DEBUG=1 \
-g -o regex regex.cc -lboost_regex-xgcc46-d-1_46_1
and the result is:
terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
This is happening in boost::re_detail::cpp_regex_traits_base<char>::imbue, on
line cpp_regex_traits.hpp:218.
The same everything, using g++ 4.5, works fine, so maybe this is a g++ 4.6
bug? I seem to recall having seen this problem before, due to mismatching a
debug Boost with a non-debug client app, or something similar. But I've have
verified that my client app is using the same flags that I build Boost with.
Has anyone run into this? Do I need to take this bug to the g++ folks? Any
pointers, ideas?
Thanks,
John
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk