2016-02-05 320 views
1

我用from the github repo建設NIX,從源頭libnix.1.1.0.dylib失敗。 一切都按照說明進行,但最終在make上失敗。就在Mac OS X

什麼,我得到的錯誤是

caffeinated:nix sudoankit$ make all 
[ 1%] Linking CXX shared library libnix.dylib 
Undefined symbols for architecture x86_64: 
    "YAML::detail::node_data::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in AttributesFS.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in DataArrayFS.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in DimensionFS.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in Directory.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in DirectoryWithAttributes.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in EntityFS.cpp.o 
     YAML::detail::node_ref::set_scalar(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in FeatureFS.cpp.o 
     ... 
    "YAML::LoadFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: 
     nix::file::AttributesFS::open_or_create()  in AttributesFS.cpp.o 
    "YAML::operator<<(std::basic_ostream<char, std::char_traits<char> >&, YAML::Node const&)", referenced from: 
     nix::file::AttributesFS::flush() in AttributesFS.cpp.o 
    "boost::re_detail_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, 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_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, 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::basic_string<char, std::char_traits<char>, std::allocator<char> > >) in util.cpp.o 
    "boost::re_detail_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::find()", referenced from: 
     bool boost::regex_search<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, 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::basic_string<char, std::char_traits<char>, std::allocator<char> > >) in util.cpp.o 
    "boost::re_detail_106000::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()", referenced from: 
     bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) in util.cpp.o 
ld: symbol(s) not found for architecture x86_64 
collect2: error: ld returned 1 exit status 
make[2]: *** [libnix.1.1.0.dylib] Error 1 
make[1]: *** [CMakeFiles/nix.dir/all] Error 2 
make: *** [all] Error 2 
caffeinated:nix sudoankit$ 

我應該如何着手在正在建造的呢?

回答

1

的C++庫依賴(即,升壓/ YAML)您已通過自制安裝用clang++編譯。結果是:缺少與GCC編譯時由STL交互產生的一些符號。

因此,你有clang++,例如編譯像這樣:

$ mkdir build 
$ CXX=clang++ CC=clang cmake -DCMAKE_BUILD_TYP=Release .. 
$ make 

望着git倉庫中,作者甚至在他們Travis CI configuration啓用的Mac OS X:

os: 
    - linux 
    - osx 

但他們也有明確排除GCC基礎上的Mac OS X:

matrix: 
    exclude: 
    - os: osx 
     compiler: gcc