#41588 closed defect (invalid)
Boost.Regex with GCC broken on Mavericks? — at Version 1
Reported by: | akimd (Akim Demaille) | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.2.1 |
Keywords: | mavericks | Cc: | ryandesign@… |
Port: | boost |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Hi,
First of all, this seems to be strongly related to this ticket: #38984.
On Mavericks (with a fresh install of MacPorts, not a plain upgrade), I have the following behavior which turns out to be very alike the one I had reported in the aforementioned ticket, except that this time GCC is broken, but Clang is not:
akim@padam /tmp $ port installed | grep gcc gcc43 @4.3.6_9 (active) gcc44 @4.4.7_8 (active) gcc45 @4.5.4_9 (active) gcc46 @4.6.4_3 (active) gcc47 @4.7.3_3 (active) gcc48 @4.8.2_0 (active) gcc49 @4.9-20131117_0 gcc49 @4.9-20131124_0 (active) gcc_select @0.1_8 (active) libgcc-devel @4.9-20131117_0 libgcc-devel @4.9-20131124_0 (active) libgcc45 @4.5.4_9 (active) akim@padam /tmp $ cat foo.cc #include <boost/regex.hpp> int main () { boost::regex exp("*"); boost::regex_match("foo", exp); return 0; } akim@padam /tmp $ g++-mp-4.8 foo.cc -L /opt/local/lib -I /opt/local/include -lboost_regex-mt Undefined symbols for architecture x86_64: "boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)", referenced from: boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, char const*) in ccaSC2nT.o "boost::re_detail::perl_matcher<char const*, std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()", referenced from: bool boost::regex_match<char const*, std::allocator<boost::sub_match<char const*> >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(char const*, char const*, boost::match_results<char const*, std::allocator<boost::sub_match<char const*> > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) in ccaSC2nT.o ld: symbol(s) not found for architecture x86_64 collect2: error: ld returned 1 exit status akim@padam /tmp $ clang++ foo.cc -L /opt/local/lib -I /opt/local/include -lboost_regex-mt akim@padam /tmp $
Change History (1)
comment:1 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign@… added |
---|---|
Description: | modified (diff) |
Resolution: | → invalid |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
You cannot mix C++ software compiled with libstdc++ (i.e. anything compiled with FSF GCC, i.e. your foo.cc) with C++ software compiled with libc++ (i.e. boost and most other ports compiled using clang, llvm-gcc, or Apple GCC on Mavericks or later). Compile your foo.cc with clang instead of FSF GCC.