Related
This is my file tree in the project
And the error is appeared like below
Ld /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Products/Release-iphoneos/face-recog-test9.app/face-recog-test9 normal arm64 (in target 'face-recog-test9' from project 'face-recog-test9')
cd /Users/chanwoo/Documents/Repositories/resonance/ios_projects/face-recog-test9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target arm64-apple-ios13.4 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk -L/Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Products/Release-iphoneos -L/Users/chanwoo/Documents/Repositories/resonance/ios_projects/face-recog-test9/lib/ -F/Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Products/Release-iphoneos -filelist /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Intermediates.noindex/face-recog-test9.build/Release-iphoneos/face-recog-test9.build/Objects-normal/arm64/face-recog-test9.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Intermediates.noindex/face-recog-test9.build/Release-iphoneos/face-recog-test9.build/Objects-normal/arm64/face-recog-test9_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Intermediates.noindex/face-recog-test9.build/Release-iphoneos/face-recog-test9.build/Objects-normal/arm64/face_recog_test9.swiftmodule -Xlinker -dependency_info -Xlinker /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Intermediates.noindex/face-recog-test9.build/Release-iphoneos/face-recog-test9.build/Objects-normal/arm64/face-recog-test9_dependency_info.dat -o /Users/chanwoo/Library/Developer/Xcode/DerivedData/face-recog-test9-fauksbwwzfttmcdxrlvcyghtcloj/Build/Products/Release-iphoneos/face-recog-test9.app/face-recog-test9
Undefined symbols for architecture arm64:
"dlib::scrollable_region::set_total_rect_size(unsigned long, unsigned long)", referenced from:
void dlib::image_display::set_image<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
"dlib::base_window::close_window()", referenced from:
dlib::drawable_window::~drawable_window() in Test.o
"dlib::image_display::get_image_display_rect() const", referenced from:
void dlib::image_window::set_image<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
void dlib::image_window::set_image<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_window::set_image<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_window::set_image<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
"dlib::base_window::invalidate_rectangle(dlib::rectangle const&)", referenced from:
dlib::image_display::disable_overlay_editing() in Test.o
void dlib::image_display::set_image<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
"dlib::base_window::base_window(bool, bool)", referenced from:
dlib::drawable_window::drawable_window(bool, bool) in Test.o
"dlib::base_window::~base_window()", referenced from:
dlib::drawable_window::drawable_window(bool, bool) in Test.o
dlib::drawable_window::~drawable_window() in Test.o
"dlib::base_window::set_size(int, int)", referenced from:
void dlib::image_window::set_image<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
void dlib::image_window::set_image<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_window::set_image<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_window::set_image<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
"vtable for dlib::image_window", referenced from:
dlib::image_window::image_window<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"dlib::base_window::set_title(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
dlib::image_window::image_window<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
dlib::image_window::image_window<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
"dlib::entropy_decoder_kernel_2::decode(unsigned int, unsigned int)", referenced from:
dlib::entropy_decoder_model_kernel_5<256ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in Test.o
dlib::entropy_decoder_model_kernel_4<256ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in Test.o
"dlib::entropy_decoder_kernel_2::get_target(unsigned int)", referenced from:
dlib::entropy_decoder_model_kernel_5<256ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in Test.o
dlib::entropy_decoder_model_kernel_4<256ul, dlib::entropy_decoder_kernel_2, 200000ul, 4ul>::decode(unsigned long&) in Test.o
"vtable for dlib::drawable_window", referenced from:
dlib::drawable_window::drawable_window(bool, bool) in Test.o
dlib::drawable_window::~drawable_window() in Test.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"dlib::entropy_decoder_kernel_2::entropy_decoder_kernel_2()", referenced from:
void dlib::load_dng<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> >&, std::__1::basic_istream<char, std::__1::char_traits<char> >&) in Test.o
"dlib::base_window::wait_until_closed() const", referenced from:
Test::test(int, char**) in Test.o
"dlib::popup_menu_region::disable()", referenced from:
void dlib::image_display::set_image<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
void dlib::image_display::set_image<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&) in Test.o
"dlib::image_window::get_next_double_click(dlib::vector<long, 2l>&, unsigned long&)", referenced from:
Test::test(int, char**) in Test.o
"_USER_ERROR__missing_dlib_all_source_cpp_file__OR__inconsistent_use_of_DEBUG_or_ENABLE_ASSERTS_preprocessor_directives_", referenced from:
__GLOBAL__sub_I_Test.cpp in Test.o
"dlib::entropy_decoder_kernel_2::set_stream(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
void dlib::load_dng<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> >&, std::__1::basic_istream<char, std::__1::char_traits<char> >&) in Test.o
"dlib::image_display::~image_display()", referenced from:
dlib::image_window::image_window<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
"dlib::image_window::~image_window()", referenced from:
Test::test(int, char**) in Test.o
"dlib::image_display::image_display(dlib::drawable_window&)", referenced from:
dlib::image_window::image_window<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
"dlib::entropy_decoder_kernel_2::~entropy_decoder_kernel_2()", referenced from:
void dlib::load_dng<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> >&, std::__1::basic_istream<char, std::__1::char_traits<char> >&) in Test.o
"Test::add(int, int)", referenced from:
-[Wrapper add_wrapper:add:] in example.o
"dlib::image_window::on_image_clicked(dlib::vector<long, 2l> const&, bool, unsigned long)", referenced from:
dlib::image_window::image_window<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_heatmap<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > >(dlib::matrix_op<dlib::op_jet<dlib::array2d<unsigned char, dlib::memory_manager_stateless_kernel_1<char> > > > const&) in Test.o
dlib::image_window::image_window<dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > >(dlib::array2d<dlib::rgb_pixel, dlib::memory_manager_stateless_kernel_1<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Test.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
First of all, I have no idea how does Xcode's linker find exactly body in libdlib.a though I didn't put the full path of it
library search path: $(PROJECT_DIR)/lib
I want to call the function from dlib in Testcpp source and wrap it using example source and finally invoke to swift code
What is wrong with it?
Env.
Mac (OSX) Catalina 10.15.4
SwiftUI (working with)
XCode 11.4
iPhone 6S
IOS 13.4.1
This error:
Undefined symbols for architecture arm64
means that the library you're trying to integrate is built for an architecture different from arm64, the one you're trying to run on. You need to rebuild the C++ library to arm64 then integrate it.
On Linux machine, my code could build successfully.
However, on my Mac, the same command cannot build unless I take out this part:
void split_is(const std::string &s, string delim_regex, std::vector<std::string> &elems) {
// Terribly slow and inefficient, sorry. Should probably fix this at some point
boost::algorithm::split_regex(elems, s, regex(delim_regex));
std::vector<std::string> non_zero_elems;
for(int e = 0; e < elems.size(); e++){
if (elems[e].length() > 0){
non_zero_elems.push_back(elems[e]);
}
}
elems = non_zero_elems; }
The command I used is:
g++ -lboost_regex -lgurobi_c++ -lgurobi60 -stdlib=libstdc++ -lpthread
-lm -Wall -m64 -fPIE -fexceptions -frounding-math -O2 -I/Library/gurobi604/mac64/include/ -I/usr/local/include/ -L/Library/gurobi604/mac64/lib/ -L/usr/local/lib/ main.cpp tools.cpp treeofdevil.cpp solver.cpp periodicfunction.cpp -o ising.exe /usr/local/lib/libboost_regex.a
Does anyone know what might possibly go wrong? Thank you.
The error I get is:
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 tools-9bd02e.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 tools-9bd02e.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 tools-9bd02e.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from:
unsigned int boost::re_detail::find_sort_syntax<boost::re_detail::cpp_regex_traits_implementation<char>, char>(boost::re_detail::cpp_regex_traits_implementation<char> const*, char*) in libboost_regex.a(instances.o)
char const* boost::re_detail::re_is_set_member<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char const*, char const*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
char* boost::re_detail::re_is_set_member<char*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char*, char*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
void std::__1::vector<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > >, std::__1::allocator<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > > >::__push_back_slow_path<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > const>(boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > const&) in libboost_regex.a(instances.o)
std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::vector(std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > > const&) in libboost_regex.a(instances.o)
std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::insert(std::__1::__wrap_iter<boost::sub_match<char const*> const*>, unsigned long, boost::sub_match<char const*> const&) in libboost_regex.a(instances.o)
std::__1::enable_if<(__is_forward_iterator<boost::sub_match<char const*>*>::value) && (is_constructible<boost::sub_match<char const*>, std::__1::iterator_traits<boost::sub_match<char const*>*>::reference>::value), void>::type std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::assign<boost::sub_match<char const*>*>(boost::sub_match<char const*>*, boost::sub_match<char const*>*) in libboost_regex.a(instances.o)
std::__1::vector<bool, std::__1::allocator<bool> >::assign(unsigned long, bool const&) in libboost_regex.a(instances.o)
std::__1::vector<bool, std::__1::allocator<bool> >::reserve(unsigned long) in libboost_regex.a(instances.o)
void std::__1::vector<std::__1::pair<bool, boost::re_detail::re_syntax_base*>, std::__1::allocator<std::__1::pair<bool, boost::re_detail::re_syntax_base*> > >::__push_back_slow_path<std::__1::pair<bool, boost::re_detail::re_syntax_base*> const>(std::__1::pair<bool, boost::re_detail::re_syntax_base*> const&) in libboost_regex.a(instances.o)
...
"std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_open_paren() in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_perl_extension() in libboost_regex.a(instances.o)
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname_imp(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::ios_base::getloc() const", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::logic_error::logic_error(char const*)", referenced from:
boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > >::raise_logic_error() in libboost_regex.a(instances.o)
"std::logic_error::logic_error(char const*)", referenced from:
boost::re_detail::perl_matcher<char const*, std::__1::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) in libboost_regex.a(instances.o)
"std::logic_error::logic_error(std::logic_error const&)", referenced from:
void boost::throw_exception<std::invalid_argument>(std::invalid_argument const&) in libboost_regex.a(instances.o)
void boost::throw_exception<std::logic_error>(std::logic_error const&) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::rethrow() const in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_impl(boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> > const&, boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_tag) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_impl(boost::exception_detail::error_info_injector<std::logic_error> const&) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::rethrow() const in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::clone_impl(boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> > const&, boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::clone_tag) in libboost_regex.a(instances.o)
...
"std::runtime_error::runtime_error(char const*)", referenced from:
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned long) in libboost_regex.a(instances.o)
"std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, ...
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::append_set(boost::re_detail::basic_char_set<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, mpl_::bool_<false>*) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(unsigned long, char)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(unsigned long, char)", referenced from:
char const* boost::re_detail::re_is_set_member<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char const*, char const*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
char* boost::re_detail::re_is_set_member<char*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char*, char*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert(std::__1::__wrap_iter<char const*>, char)", referenced from:
boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::append_set(boost::re_detail::basic_char_set<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, mpl_::bool_<false>*) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__grow_by(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::catalog_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::get_catalog_name() in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse(char const*, char const*, unsigned int) in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long) in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_extended() in libboost_regex.a(instances.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
.....const in libboost_regex.a(instances.o)
boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::imbue(std::__1::locale) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::imbue(std::__1::locale) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::do_get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned long) in libboost_regex.a(instances.o)
unsigned long std::__1::__tree<std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> >, std::__1::__map_value_compare<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> >, std::__1::less<boost::re_detail::cpp_regex_traits_base<char> >, true>, std::__1::allocator<std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> > > >::__erase_unique<boost::re_detail::cpp_regex_traits_base<char> >(boost::re_detail::cpp_regex_traits_base<char> const&) in libboost_regex.a(instances.o)
...
"std::__1::locale::operator=(std::__1::locale const&)", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::collate<char>::id", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::ios_base::init(void*)", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::ios_base::clear(unsigned int)", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::numpunct<char>::id", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::basic_ios<char, std::__1::char_traits<char> >::~basic_ios()", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"typeinfo for std::__1::basic_streambuf<char, std::__1::char_traits<char> >", referenced from:
typeinfo for boost::re_detail::parser_buf<char, std::__1::char_traits<char> > in libboost_regex.a(instances.o)
"vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I suspect that you have more than one thing going on here; moving -lboost_regex should solve some of them.
I suspect that the main problem you have is that you've built part of your program (the boost libraries, probably) with libc++, and the rest with libstdc++.
Your build command explicitly says -stdlib=libstdc++, but the error message mentions std::__1::...., which is where things live in libc++.
I have successfully installed and tested HealPix 3.11 on my Linux and MacBookPro running OS X 10.9.5. On Mac OS while compiling healpix Library, in the configure script I chose 'cxx' and 'osx'.
Note:On the linux system it is working perfectly fine.
However, on my OS X system when I try to use it for my own simple healpix example, it compiles but doesn't link properly. Here are the linking errors I am getting:
Scanning dependencies of target garage-diff-sphericaldomain-demo1
[100%] Building CXX object CMakeFiles/bin/garage-diff-sphericaldomain-demo1.dir/src/demos/fft-demos/diff-sphericaldomain-demo1.cxx.o
Linking CXX executable bin/garage-diff-sphericaldomain-demo1
Undefined symbols for architecture x86_64:
"std::string::find_last_not_of(char const*, unsigned long, unsigned long) const", referenced from:
trim(std::string const&) in libcxxsupport.a(string_utils.o)
"std::string::find_first_not_of(char const*, unsigned long, unsigned long) const", referenced from:
trim(std::string const&) in libcxxsupport.a(string_utils.o)
"std::string::find(char const*, unsigned long, unsigned long) const", referenced from:
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
"std::string::compare(char const*) const", referenced from:
planck_failure__(char const*, int, char const*, std::string const&) in libcxxsupport.a(error_handling.o)
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_words_from_file(std::string const&, std::vector<std::string, std::allocator<std::string> >&) in libcxxsupport.a(string_utils.o)
"std::ctype<char>::_M_widen_init() const", referenced from:
planck_failure__(char const*, int, char const*, std::string const&) in libcxxsupport.a(error_handling.o)
operator<<(std::ostream&, pointing const&) in libcxxsupport.a(pointing.o)
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
intToString(long, unsigned long) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<double>(double&)", referenced from:
void stringToData<double>(std::string const&, double&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<long double>(long double&)", referenced from:
void stringToData<long double>(std::string const&, long double&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<float>(float&)", referenced from:
void stringToData<float>(std::string const&, float&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<unsigned int>(unsigned int&)", referenced from:
void stringToData<unsigned int>(std::string const&, unsigned int&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<long>(long&)", referenced from:
void stringToData<long>(std::string const&, long&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<unsigned long>(unsigned long&)", referenced from:
void stringToData<unsigned long>(std::string const&, unsigned long&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<unsigned short>(unsigned short&)", referenced from:
void stringToData<unsigned short>(std::string const&, unsigned short&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<long long>(long long&)", referenced from:
void stringToData<long long>(std::string const&, long long&) in libcxxsupport.a(string_utils.o)
"std::istream& std::istream::_M_extract<unsigned long long>(unsigned long long&)", referenced from:
void stringToData<unsigned long long>(std::string const&, unsigned long long&) in libcxxsupport.a(string_utils.o)
"std::istream::operator>>(int&)", referenced from:
void stringToData<int>(std::string const&, int&) in libcxxsupport.a(string_utils.o)
"std::istream::operator>>(short&)", referenced from:
void stringToData<short>(std::string const&, short&) in libcxxsupport.a(string_utils.o)
"std::ostream::put(char)", referenced from:
planck_failure__(char const*, int, char const*, std::string const&) in libcxxsupport.a(error_handling.o)
operator<<(std::ostream&, pointing const&) in libcxxsupport.a(pointing.o)
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
"std::ostream::flush()", referenced from:
planck_failure__(char const*, int, char const*, std::string const&) in libcxxsupport.a(error_handling.o)
operator<<(std::ostream&, pointing const&) in libcxxsupport.a(pointing.o)
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<double>(double)", referenced from:
operator<<(std::ostream&, pointing const&) in libcxxsupport.a(pointing.o)
std::string dataToString<double>(double const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<float>(float const&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<long double>(long double)", referenced from:
std::string dataToString<long double>(long double const&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<long>(long)", referenced from:
intToString(long, unsigned long) in libcxxsupport.a(string_utils.o)
std::string dataToString<long>(long const&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)", referenced from:
std::string dataToString<unsigned long>(unsigned long const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<unsigned short>(unsigned short const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<unsigned int>(unsigned int const&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<long long>(long long)", referenced from:
std::string dataToString<long long>(long long const&) in libcxxsupport.a(string_utils.o)
"std::ostream& std::ostream::_M_insert<unsigned long long>(unsigned long long)", referenced from:
std::string dataToString<unsigned long long>(unsigned long long const&) in libcxxsupport.a(string_utils.o)
"std::ostream::operator<<(int)", referenced from:
planck_failure__(char const*, int, char const*, std::string const&) in libcxxsupport.a(error_handling.o)
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
std::string dataToString<int>(int const&) in libcxxsupport.a(string_utils.o)
"std::ostream::operator<<(short)", referenced from:
std::string dataToString<short>(short const&) in libcxxsupport.a(string_utils.o)
"std::string::_M_leak_hard()", referenced from:
tolower(std::string const&) in libcxxsupport.a(string_utils.o)
"std::string::_Rep::_M_destroy(std::allocator<char> const&)", referenced from:
PlanckError::~PlanckError() in libcxxsupport.a(error_handling.o)
PlanckError::~PlanckError() in libcxxsupport.a(error_handling.o)
planck_failure__(char const*, int, char const*, char const*) in libcxxsupport.a(error_handling.o)
string2HealpixScheme(std::string const&) in libhealpix_cxx.a(healpix_tables.o)
(anonymous namespace)::end_stringToData(std::string const&, char const*, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&) in libcxxsupport.a(string_utils.o)
void stringToData<std::string>(std::string const&, std::string&) in libcxxsupport.a(string_utils.o)
void stringToData<bool>(std::string const&, bool&) in libcxxsupport.a(string_utils.o)
...
"std::string::_Rep::_S_empty_rep_storage", referenced from:
PlanckError::~PlanckError() in libcxxsupport.a(error_handling.o)
PlanckError::~PlanckError() in libcxxsupport.a(error_handling.o)
planck_failure__(char const*, int, char const*, char const*) in libcxxsupport.a(error_handling.o)
string2HealpixScheme(std::string const&) in libhealpix_cxx.a(healpix_tables.o)
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libhealpix_cxx.a(healpix_tables.o)
(anonymous namespace)::end_stringToData(std::string const&, char const*, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&) in libcxxsupport.a(string_utils.o)
void stringToData<std::string>(std::string const&, std::string&) in libcxxsupport.a(string_utils.o)
...
"std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&)", referenced from:
char* std::string::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag) in libcxxsupport.a(string_utils.o)
"std::string::append(char const*, unsigned long)", referenced from:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libhealpix_cxx.a(healpix_tables.o)
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*) in libhealpix_cxx.a(healpix_tables.o)
(anonymous namespace)::end_stringToData(std::string const&, char const*, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&) in libcxxsupport.a(string_utils.o)
void stringToData<bool>(std::string const&, bool&) in libcxxsupport.a(string_utils.o)
void split<float>(std::string const&, std::vector<float, std::allocator<float> >&) in libcxxsupport.a(string_utils.o)
void split<double>(std::string const&, std::vector<double, std::allocator<double> >&) in libcxxsupport.a(string_utils.o)
void split<int>(std::string const&, std::vector<int, std::allocator<int> >&) in libcxxsupport.a(string_utils.o)
...
"std::string::append(std::string const&)", referenced from:
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libhealpix_cxx.a(healpix_tables.o)
(anonymous namespace)::end_stringToData(std::string const&, char const*, std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >&) in libcxxsupport.a(string_utils.o)
std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libcxxsupport.a(string_utils.o)
"std::string::assign(char const*, unsigned long)", referenced from:
parse_cmdline_classic(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_cmdline_equalsign(int, char const**, std::vector<std::string, std::allocator<std::string> > const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
"std::string::assign(std::string const&)", referenced from:
void stringToData<std::string>(std::string const&, std::string&) in libcxxsupport.a(string_utils.o)
"VTT for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >", referenced from:
std::string dataToString<short>(short const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<double>(double const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<long long>(long long const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<long double>(long double const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<unsigned long>(unsigned long const&) in libcxxsupport.a(string_utils.o)
intToString(long, unsigned long) in libcxxsupport.a(string_utils.o)
std::string dataToString<long>(long const&) in libcxxsupport.a(string_utils.o)
...
"vtable for std::basic_filebuf<char, std::char_traits<char> >", referenced from:
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_words_from_file(std::string const&, std::vector<std::string, std::allocator<std::string> >&) in libcxxsupport.a(string_utils.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_ifstream<char, std::char_traits<char> >", referenced from:
parse_file(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&) in libcxxsupport.a(string_utils.o)
parse_words_from_file(std::string const&, std::vector<std::string, std::allocator<std::string> >&) in libcxxsupport.a(string_utils.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_streambuf<char, std::char_traits<char> >", referenced from:
void stringToData<long double>(std::string const&, long double&) in libcxxsupport.a(string_utils.o)
void stringToData<double>(std::string const&, double&) in libcxxsupport.a(string_utils.o)
void stringToData<float>(std::string const&, float&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long long>(std::string const&, unsigned long long&) in libcxxsupport.a(string_utils.o)
void stringToData<long long>(std::string const&, long long&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long>(std::string const&, unsigned long&) in libcxxsupport.a(string_utils.o)
void stringToData<long>(std::string const&, long&) in libcxxsupport.a(string_utils.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >", referenced from:
void stringToData<long double>(std::string const&, long double&) in libcxxsupport.a(string_utils.o)
void stringToData<double>(std::string const&, double&) in libcxxsupport.a(string_utils.o)
void stringToData<float>(std::string const&, float&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long long>(std::string const&, unsigned long long&) in libcxxsupport.a(string_utils.o)
void stringToData<long long>(std::string const&, long long&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long>(std::string const&, unsigned long&) in libcxxsupport.a(string_utils.o)
void stringToData<long>(std::string const&, long&) in libcxxsupport.a(string_utils.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >", referenced from:
void stringToData<long double>(std::string const&, long double&) in libcxxsupport.a(string_utils.o)
void stringToData<double>(std::string const&, double&) in libcxxsupport.a(string_utils.o)
void stringToData<float>(std::string const&, float&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long long>(std::string const&, unsigned long long&) in libcxxsupport.a(string_utils.o)
void stringToData<long long>(std::string const&, long long&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long>(std::string const&, unsigned long&) in libcxxsupport.a(string_utils.o)
void stringToData<long>(std::string const&, long&) in libcxxsupport.a(string_utils.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >", referenced from:
std::string dataToString<short>(short const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<double>(double const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<long long>(long long const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<long double>(long double const&) in libcxxsupport.a(string_utils.o)
std::string dataToString<unsigned long>(unsigned long const&) in libcxxsupport.a(string_utils.o)
intToString(long, unsigned long) in libcxxsupport.a(string_utils.o)
std::string dataToString<long>(long const&) in libcxxsupport.a(string_utils.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for std::basic_ios<char, std::char_traits<char> >", referenced from:
void stringToData<long double>(std::string const&, long double&) in libcxxsupport.a(string_utils.o)
void stringToData<double>(std::string const&, double&) in libcxxsupport.a(string_utils.o)
void stringToData<float>(std::string const&, float&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long long>(std::string const&, unsigned long long&) in libcxxsupport.a(string_utils.o)
void stringToData<long long>(std::string const&, long long&) in libcxxsupport.a(string_utils.o)
void stringToData<unsigned long>(std::string const&, unsigned long&) in libcxxsupport.a(string_utils.o)
void stringToData<long>(std::string const&, long&) in libcxxsupport.a(string_utils.o)
...
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/garage-diff-sphericaldomain-demo1] Error 1
make[1]: *** [CMakeFiles/bin/garage-diff-sphericaldomain-demo1.dir/all] Error 2
make: *** [all] Error 2
This error is only coming from the libcxxsupport.a linking static library which is very weird.
Here is the link to the FindHealPix.cmake file I used to compile my program. As mentioned before, I have been able to compile and link without any problem on the linux ubuntu 14.04 version machine.
Finally I found a way to make it work.
I started getting additional kind of error due to the use of OpenMP in the Healpix_3.11 library, which I didn't understand why. This error was looking like that:
Undefined symbols for architecture x86_64:
"_GOMP_critical_end", referenced from:
_sharp_execute_job._omp_fn.0 in libsharp.a(sharp.o)
"_GOMP_critical_start", referenced from:
_sharp_execute_job._omp_fn.0 in libsharp.a(sharp.o)
"_GOMP_loop_dynamic_next", referenced from:
_sharp_execute_job._omp_fn.0 in libsharp.a(sharp.o)
_phase2map._omp_fn.2 in libsharp.a(sharp.o)
_map2phase._omp_fn.1 in libsharp.a(sharp.o)
_gauss_legendre_tbl._omp_fn.0 in libsharp.a(sharp_geomhelpers.o)
"_GOMP_loop_dynamic_start", referenced from:
_sharp_execute_job._omp_fn.0 in libsharp.a(sharp.o)
_phase2map._omp_fn.2 in libsharp.a(sharp.o)
_map2phase._omp_fn.1 in libsharp.a(sharp.o)
_gauss_legendre_tbl._omp_fn.0 in libsharp.a(sharp_geomhelpers.o)
"_GOMP_loop_end", referenced from:
_sharp_execute_job._omp_fn.0 in libsharp.a(sharp.o)
_phase2map._omp_fn.2 in libsharp.a(sharp.o)
_map2phase._omp_fn.1 in libsharp.a(sharp.o)
"_GOMP_loop_end_nowait", referenced from:
_gauss_legendre_tbl._omp_fn.0 in libsharp.a(sharp_geomhelpers.o)
"_GOMP_parallel_end", referenced from:
...
But after google search I found that this error is coming because the Clang APPLE compiler does not allow usage of -fopenmp flag. Therefore, I had to find a way to force my CMakeLists.txt to use gcc and g++ in my project.
So, The problem was with the Clang Mac OS X 10.9.5 Compiler. Here is a quick answer in steps:
Make sure your gcc and g++ compiler in /usr/bin or /usr/local/bin is linked to gcc-49 and g++-4.9 respectively. Check here for help.
Make sure your CMake is calling a g++ and gcc compiler and not the APPLE Clang compiler. If you get below message while running cmake . that means your cmake is calling Clang.
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
You can very easily change above behaviour by declaring following lines above project() line in your CMakeLists.txt . In my that looks like this:
...
if(APPLE)
SET(CMAKE_C_COMPILER_INIT gcc)
SET(CMAKE_CXX_COMPILER_INIT g++)
endif(APPLE)
project(Healpix)
...
For more help regarding CMake Compilers checkout another stackoverflow answer and Change CMake compiler/tools.
EDIT:
To run a test example, like this one, you can use a terminal command line:
g++ healpix-demo1.cxx -I/usr/local/opt/cfitsio/include
-I/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/c_utils
-I/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/libfftpack
-I/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/libsharp
-I/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/cxxsupport
-I/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/Healpix_cxx
-L. -L/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib
-fopenmp -fPIC -O2 -ffast-math -fomit-frame-pointer /Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib/libhealpix_cxx.a
/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib/libcxxsupport.a
/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib/libsharp.a
/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib/libfftpack.a
/Users/gsingh/Programming/garage/third-party/Healpix_3.11/src/cxx/osx/lib/libc_utils.a
-L/usr/local/opt/cfitsio/lib -lcfitsio
How can one use logging library from Boost on version 1.54 ? (I'm using QtCreator and have successfully used boost/filesystem)
I read that the logging lib is now part of Boost, but I can't make it work on MacOs:
My .pro file:
#-------------------------------------------------
#
# Project created by QtCreator 2013-10-30T14:34:26
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Fottopic
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
configwindow.cpp \
windowmanager.cpp
HEADERS += mainwindow.h \
configwindow.h \
windowmanager.h
INCLUDEPATH += /usr/local/Cellar/boost/1.54.0/include
QMAKE_LIBDIR += /usr/local/Cellar/boost/1.54.0/lib
LIBS += -lboost_system\
-lboost_filesystem\
-lboost_log\
-lboost_log_setup
Output when building:
Undefined symbols for architecture x86_64:
"boost::log::v2s_mt_posix::sinks::text_file_backend::~text_file_backend()", referenced from:
boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::text_file_backend>::destroy() in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::construct(boost::filesystem::path const&, std::_Ios_Openmode, unsigned long, boost::log::v2s_mt_posix::aux::light_function<bool ()()> const&, bool)", referenced from:
void boost::log::v2s_mt_posix::sinks::text_file_backend::construct<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::flush()", referenced from:
void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&, mpl_::bool_<true>)in main.o
"boost::detail::get_tss_data(void const*)", referenced from:
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::get() constin main.o
"boost::detail::set_tss_data(void const*, boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)", referenced from:
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::reset(boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context*)in main.o
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::~thread_specific_ptr()in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)in main.o
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)in main.o
"boost::log::v2s_mt_posix::aux::default_attribute_names::message()", referenced from:
boost::log::v2s_mt_posix::expressions::tag::message::get_name() in main.o
"boost::log::v2s_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::locale const&)", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >& boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >::formatted_write<wchar_t>(wchar_t const*, long)in main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::enter_once_block() const", referenced from:
boost::log::v2s_mt_posix::aux::once_block_sentry::executed() constin main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()", referenced from:
boost::log::v2s_mt_posix::aux::once_block_sentry::~once_block_sentry()in main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::commit()", referenced from:
boost::array<std::pair<boost::log::v2s_mt_posix::type_info_wrapper, void*>, 2ul> const& boost::log::v2s_mt_posix::aux::type_sequence_dispatcher<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >::get_dispatching_map<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >()in main.o
"boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::attribute_value_set::end() const", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2s_mt_posix::attribute_name const&)", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::set_file_collector(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::file::collector> const&)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::scan_for_files(boost::log::v2s_mt_posix::sinks::file::scan_method, bool)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::core::get()", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [Fottopic.app/Contents/MacOS/Fottopic] Error 1
17:48:19: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Fottopic (kit: Desktop)
When executing step 'Make'
I have made an iPhone app in Xcode that uses the DropBox API. I have got 23 errors all named Apple Mach-O Linker Errors. I have linked my binary with the dropbox library as well as: SystemConfiguration, QuartzCore, Security, CFNetwork, CoreGraphics, UIKit and Foundation. I am not using all of those frameworks but DropBox told me I must import some of them, and I am using the rest.
What should I do?
Here is one of the errors:
Ld /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop normal armv7
cd /Users/Zach/Desktop/SnapDrop
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode5-DP3.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode5-DP3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Desktop/SnapDrop -F/Users/Zach/Desktop/SnapDrop/../../Downloads/dropbox-ios-sync-sdk-1-1.1.0 -filelist /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework Dropbox -framework QuartzCore -framework SystemConfiguration -framework Security -framework CFNetwork -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop_dependency_info.dat -o /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop
Undefined symbols for architecture armv7:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"operator new(unsigned long)", referenced from:
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::__clone() const in Dropbox(env.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::chrono::system_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::chrono::steady_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
dbx_access_info::is_valid(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in Dropbox(sync.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::__throw_system_error(int, char const*)", referenced from:
std::__1::unique_lock<std::__1::mutex>::unlock() in Dropbox(transfer.o)
std::__1::unique_lock<std::__1::mutex>::lock() in Dropbox(transfer.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)", referenced from:
LifecycleManager::shutdown() in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::nothrow", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
dbx_env::~dbx_env() in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_request_json(dbx_account*, HttpRequester&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, char const*, int, std::initializer_list<int> const&, std::__1::unique_ptr<json_t, json_deleter>&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
...
"std::__1::condition_variable::notify_all()", referenced from:
LifecycleManager::kick_cvars() in Dropbox(init.o)
LifecycleManager::ThreadRegistration::~ThreadRegistration() in Dropbox(transfer.o)
LifecycleManager::ThreadRegistration::ThreadRegistration(LifecycleManager&) in Dropbox(transfer.o)
dbx_env::dump_log_buffer() const in Dropbox(env.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::__1::condition_variable::~condition_variable()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"std::__1::mutex::unlock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
"operator new(unsigned long, std::nothrow_t const&)", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000000ll> > >)", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::mutex::~mutex()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"operator delete(void*)", referenced from:
_dropbox_env_destroy in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::~__func() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::destroy_deallocate() in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
dbx_env::dbx_env(dbx_http const*, dbx_env_config const*) in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::mutex::lock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You didn't mention adding libc++.dylib. Per https://www.dropbox.com/developers/sync/sdks/ios:
Ensure that you have CFNetwork.framework, Security.framework,
SystemConfiguration.framework, QuartzCore.framework, and libc++.dylib
added to your project. To do this, select your project file in the
file explorer, select your target, and select the Build Phases
sub-tab. Under Link Binary with Libraries, press the + button, select
CFNetwork.framework, and press Add. Repeat for Security.framework,
SystemConfiguration.framework, QuartzCore.framework, and libc++.dylib.
Please let me know if there are setup instructions somewhere that don't mention libc++.dylib.
You could try to add libstdc++.dylib.