[CXX-315] Installing legacy-1.0.0-rc0 on Mac OS X fails Created: 26/Aug/14  Updated: 13/Nov/14  Resolved: 02/Sep/14

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: legacy-1.0.0-rc0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Daniel Alabi Assignee: Unassigned
Resolution: Done Votes: 0
Labels: legacy-cxx
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CXX-221 Target current platform rather than l... Closed

 Description   

I cloned the `mongo-cxx-driver` repo, switched to the legacy-1.0.0-rc0 release, ran `scons` and got the following error:
```
scons: Building targets ...
Creating 'build/darwin/normal/mongo/version.h'
g++ -o build/darwin/normal/authTest -fPIC -Wl,-bind_at_load -mmacosx-version-min=10.6 build/darwin/normal/mongo/client/examples/authTest.o build/darwin/normal/libmongoclient.a -lboost_regex-mt -lboost_thread-mt -lboost_system-mt
Undefined symbols for architecture x86_64:
"boost::match_results<_gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::_normal_iterator<char const*, std::string> > > > const&)", referenced from:
boost::re_detail::perl_matcher<_gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::_normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_prefix() in libmongoclient.a(dbclient.o)
boost::re_detail::perl_matcher<_gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::_normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match() in libmongoclient.a(dbclient.o)
"boost::re_detail::perl_matcher<_gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::_normal_iterator<char const*, std::string> > >, 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<_gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(gnu_cxx::normal_iterator<char const*, std::string>, __gnu_cxx::normal_iterator<char const*, std::string>, boost::match_results<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::_normal_iterator<char const*, std::string>) in libmongoclient.a(dbclient.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [build/darwin/normal/authTest] Error 1
scons: building terminated because of errors.
```



 Comments   
Comment by Tyler Brock [ 28/Aug/14 ]

Yup, this is not great. I believe it should build if you invoke `scons` and do reasonable platform detection (for which the latest mac os should not be considered exotic)

Comment by Daniel Alabi [ 27/Aug/14 ]

It works by invoking `scons --osx-version-min=10.7 --libc++`. I'm just (mostly randomly) going through most drivers and learning to use them. I'll submit a pull request that just deletes some errant IP address. It might be helpful to update the docs so that's it clear that `scons` alone doesn't work (on all OS's). CXX-211 also seems really important too.

Comment by Andrew Morrow (Inactive) [ 26/Aug/14 ]

Hi daniel.alabi@10gen.com

I think you are building against boost libraries that were linked with libc++ rather than libstdc++, but you are building the driver against the libstdc++ headers (there are two standard libraries that ship on modern OS X).

The fix is likely to be either:

  • relink boost against libstdc++ rather than libc++
  • Request libc++ explicitly by passing --osx-version-min=10.7 --libc++ to your scons invocation.

Thanks,
Andrew

Generated at Wed Feb 07 21:58:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.