boost regex no debug info and std::bad_cast
Hi, I'm trying to use boost/regex.hpp on OS X 10.6.4 10F569. $ g++ -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1 Thread model: posix gcc version 4.2.1 (Apple Inc. build 5664) BOOST BUILD $ ./bootstrap.sh --prefix=$BOOST_INSTALL $ ./bjam debug define=_GLIBCXX_DEBUG install --prefix=$BOOST_INSTALL MAKEFILE $ g++ -Wall -g -I~/Development/BOOST/boost_1_44_0 ~/Development/BOOST/BOOST_INSTALL/lib/libboost_regex.a example.cpp -o example example.cpp #include <iostream> #include <iterator> #include <algorithm> #include <boost/regex.hpp> int main() { std::string s("table.dat"); boost::regex expression("table.dat"); boost::regex_match(s, expression); return 0; } Problems (2): 1. $ ./example terminate called after throwing an instance of 'std::bad_cast' what(): std::bad_cast Abort trap 2. $ gdb example This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ... done warning: Could not find object file "/var/folders/Hk/HkJ3ILZ4GcOnWEOL-4iWEE+++TI/-Tmp-//ccC7Ee4y.o" - no debug information available for "example.cpp". Any help is appreciated, Justin -- View this message in context: http://boost.2283326.n4.nabble.com/boost-regex-no-debug-info-and-std-bad-cas... Sent from the Boost - Users mailing list archive at Nabble.com.
I'm trying to use boost/regex.hpp on OS X 10.6.4 10F569.
I notice that you're building the regex library with _GLIBCXX_DEBUG defined, but that you're not defining that in your application build - that will almost certainly result in binary compatibility issues that will break the executable. Can you try building everything *without* _GLIBCXX_DEBUG, and then if that's working, try *everything* with _GLIBCXX_DEBUG if that's what you want. As for why you're program has no debug issue - I've no idea - it's a GCC issue really I guess? HTH, John.
participants (2)
-
John Maddock
-
justin