boost regex built failed on MacOX - c++

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++.

Related

Linking error running minimum GTest example

I'm beginning to learn how to use GTest to test a few Cpp and C libraries:
https://github.com/google/googletest
I'm trying out GTest on my macbook, with g++ version
$ g++ --version
g++ (Homebrew GCC 4.9.4_1) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
The installation appears successfully, e.g. after sudo make install:
...
-- Installing: /usr/local/lib/libgtest.a
-- Installing: /usr/local/lib/libgtest_main.a
...
I've been following this tutorial from a few months ago, https://www.youtube.com/watch?v=nbFXI9SDfbk
Here is the minimal working example:
#include <iostream>
#include <gtest/gtest.h>
using namespace std;
int main(int argc, char **argv){
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
Here is how it's recommended to be compiled:
$ g++ Test.cpp -lgtest -lgtest_main -pthread
Above, the libraries are there, and this version of g++ should have -pthread capabilities built in. I get a massive linking error, for reasons I don't understand. Is there an obvious reason why the linking isn't working?
Here's the error, truncated for size:
$ g++ Test.cpp -lgtest -lgtest_main -pthread
/var/folders/1d/_h9qdvds6l5d7x78b21pn1_45n_16x/T//ccYIGdBL.s:7:11: warning: section "__textcoal_nt" is deprecated
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
/var/folders/1d/_h9qdvds6l5d7x78b21pn1_45n_16x/T//ccYIGdBL.s:7:11: note: change section name to "__text"
.section __TEXT,__textcoal_nt,coalesced,pure_instructions
^ ~~~~~~~~~~~~~
Undefined symbols for architecture x86_64:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
testing::internal::SplitString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libgtest.a(gtest-all.cc.o)
testing::internal::FormatDeathTestOutput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const", referenced from:
testing::internal::EqFailure(char const*, char 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&, bool) in libgtest.a(gtest-all.cc.o)
testing::GetReservedAttributesForElement(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestImpl::ConfigureXmlOutput() in libgtest.a(gtest-all.cc.o)
void testing::internal::ParseGoogleTestFlagsOnlyImpl<char>(int*, char**) in libgtest.a(gtest-all.cc.o)
void testing::internal::ParseGoogleTestFlagsOnlyImpl<wchar_t>(int*, wchar_t**) in libgtest.a(gtest-all.cc.o)
testing::internal::InDeathTestChild() in libgtest.a(gtest-all.cc.o)
testing::internal::DefaultDeathTestFactory::Create(char const*, testing::internal::RE const*, char const*, int, testing::internal::DeathTest**) in libgtest.a(gtest-all.cc.o)
...
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
std::__1::vector<testing::TestCase*, std::__1::allocator<testing::TestCase*> >::insert(std::__1::__wrap_iter<testing::TestCase* const*>, testing::TestCase* const&) in libgtest.a(gtest-all.cc.o)
std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
void std::__1::vector<char*, std::__1::allocator<char*> >::__push_back_slow_path<char* const>(char* const&) in libgtest.a(gtest-all.cc.o)
std::__1::vector<char*, std::__1::allocator<char*> >::insert(std::__1::__wrap_iter<char* const*>, char* const&) in libgtest.a(gtest-all.cc.o)
void std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::__push_back_slow_path<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&) in libgtest.a(gtest-all.cc.o)
std::__1::vector<double, std::__1::allocator<double> >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
...
"std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
std::__1::vector<testing::TestPartResult, std::__1::allocator<testing::TestPartResult> >::at(unsigned long) const in libgtest.a(gtest-all.cc.o)
std::__1::vector<testing::TestProperty, std::__1::allocator<testing::TestProperty> >::at(unsigned long) const in libgtest.a(gtest-all.cc.o)
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPKcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeESA_SA_ in libgtest.a(gtest-all.cc.o)
__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueEvE4typeES9_S9_ in libgtest.a(gtest-all.cc.o)
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libgtest.a(gtest-all.cc.o)
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in libgtest.a(gtest-all.cc.o)
"std::logic_error::logic_error(char const*)", referenced from:
std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, unsigned long, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, unsigned long> > >::__construct_node_with_key(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
std::__1::list<std::__1::pair<char, char const*>, std::__1::allocator<std::__1::pair<char, char const*> > >::push_back(std::__1::pair<char, char const*> const&) in libgtest.a(gtest-all.cc.o)
std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
std::__1::__split_buffer<char*, std::__1::allocator<char*>&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<char*>&) in libgtest.a(gtest-all.cc.o)
std::__1::__split_buffer<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) in libgtest.a(gtest-all.cc.o)
std::__1::vector<double, std::__1::allocator<double> >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
std::__1::vector<std::__1::vector<double, std::__1::allocator<double> >, std::__1::allocator<std::__1::vector<double, std::__1::allocator<double> > > >::allocate(unsigned long) in libgtest.a(gtest-all.cc.o)
...
"std::runtime_error::runtime_error(char const*)", referenced from:
testing::internal::GoogleTestFailureException::GoogleTestFailureException(testing::TestPartResult const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::erase(unsigned long, unsigned long)", referenced from:
testing::internal::StripTrailingSpaces(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
testing::internal::OutputFlagAlsoCheckEnvVar() in libgtest.a(gtest-all.cc.o)
testing::internal::FilePath::RemoveDirectoryName() const in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestOptions::GetOutputFormat() in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestOptions::GetAbsolutePathToOutputFile() in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestOptions::FilterMatchesTest(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&) in libgtest.a(gtest-all.cc.o)
testing::internal::HasOneFailure(char const*, char const*, char const*, testing::TestPartResultArray const&, testing::TestPartResult::Type, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
testing::internal::String::ShowWideCString(wchar_t const*) in libgtest.a(gtest-all.cc.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long, unsigned long)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(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&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
testing::internal::Indent(int) in libgtest.a(gtest-all.cc.o)
std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libgtest.a(gtest-all.cc.o)
testing::internal::FormatDeathTestOutput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
testing::AssertionResult::AppendMessage(testing::Message const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(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&) in libgtest.a(gtest-all.cc.o)
testing::internal::FormatDeathTestOutput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
testing::internal::UnitTestOptions::FilterMatchesTest(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&) in libgtest.a(gtest-all.cc.o)
testing::internal::FilePath::RemoveFileName() const in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestImpl::RecordProperty(testing::TestProperty const&) in libgtest.a(gtest-all.cc.o)
testing::internal::FilePath::Normalize() in libgtest.a(gtest-all.cc.o)
testing::internal::CapturedStream::CapturedStream(int) in libgtest.a(gtest-all.cc.o)
bool testing::internal::ParseStringFlag<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(char const*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::resize(unsigned long, char)", referenced from:
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in libgtest.a(gtest-all.cc.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::str(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libgtest.a(gtest-all.cc.o)
testing::internal::XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
testing::internal::StringStreamToString(std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >*) in libgtest.a(gtest-all.cc.o)
testing::internal::XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char) in libgtest.a(gtest-all.cc.o)
std::__1::basic_stringbuf<char, std::__1::char_traits<char>, std::__1::allocator<char> >::overflow(int) in libgtest.a(gtest-all.cc.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:
testing::internal::AppendUserMessage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, testing::Message const&) in libgtest.a(gtest-all.cc.o)
testing::internal::UnitTestOptions::GetAbsolutePathToOutputFile() in libgtest.a(gtest-all.cc.o)
testing::internal::SingleFailureChecker::SingleFailureChecker(testing::TestPartResultArray const*, testing::TestPartResult::Type, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
testing::internal::SplitString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libgtest.a(gtest-all.cc.o)
testing::AssertionResult::AssertionResult(testing::AssertionResult const&) in libgtest.a(gtest-all.cc.o)
testing::internal::(anonymous namespace)::SplitEscapedString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
testing::TestInfo::TestInfo(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&, char const*, char const*, testing::internal::CodeLocation, void const*, testing::internal::TestFactoryBase*) in libgtest.a(gtest-all.cc.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&, unsigned long, unsigned long, std::__1::allocator<char> const&)", referenced from:
testing::internal::SplitString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libgtest.a(gtest-all.cc.o)
....
"virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream()", referenced from:
construction vtable for std::__1::basic_ostream<char, std::__1::char_traits<char> >-in-std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libgtest.a(gtest-all.cc.o)
"virtual thunk to std::__1::basic_ostream<char, std::__1::char_traits<char> >::~basic_ostream()", referenced from:
construction vtable for std::__1::basic_ostream<char, std::__1::char_traits<char> >-in-std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libgtest.a(gtest-all.cc.o)
"virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits<char> >-in-std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libgtest.a(gtest-all.cc.o)
"virtual thunk to std::__1::basic_iostream<char, std::__1::char_traits<char> >::~basic_iostream()", referenced from:
construction vtable for std::__1::basic_iostream<char, std::__1::char_traits<char> >-in-std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> > in libgtest.a(gtest-all.cc.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

HealPix C++ Linking error on Mac OS X 10.9.5

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

Fail linking with C++ library on iOS project

I'm trying to link against libupnpx, followed the instructions but I can't seem to link against the C++ standard library.
Other linker flags are set to -lstdc++ -all_load (as you can see here), however, it can't seem to find C++ functions : here.
Any idea what I might be missing ?
Thanks.
EDIT : As #Speeder asked, here are the full logs :
Ld /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator/OrangeTV.app/OrangeTV normal x86_64
cd /Users/Maxime/Documents/OrangeTV/OrangeTV
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator -L../Third-Party -L../Third-Party/upnpx -L../Third-Party/upnpx/api -L../Third-Party/upnpx/common -L../Third-Party/upnpx/eventserver -L../Third-Party/upnpx/generator -L../Third-Party/upnpx/port -L../Third-Party/upnpx/ssdp -L../Third-Party/upnpx/upnp -L../Third-Party/upnpx/port/ios -L../Third-Party/upnpx/port/macos -F/Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator -filelist /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Intermediates/OrangeTV.build/Debug-iphonesimulator/OrangeTV.build/Objects-normal/x86_64/OrangeTV.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -lstdc++ -all_load -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -lupnpx -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Intermediates/OrangeTV.build/Debug-iphonesimulator/OrangeTV.build/Objects-normal/x86_64/OrangeTV_dependency_info.dat -o /Users/Maxime/Library/Developer/Xcode/DerivedData/OrangeTV-gjzdhpgbpshbbndllvftwfurgmek/Build/Products/Debug-iphonesimulator/OrangeTV.app/OrangeTV
Undefined symbols for architecture x86_64:
"std::string::find(char const*, unsigned long) const", referenced from:
SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::string::c_str() const", referenced from:
BasicHTTPObserver_wrapper::CanProcessMethod(std::string*) in libupnpx.a(BasicHTTPServer_ObjC.o)
BasicHTTPObserver_wrapper::Request(char*, unsigned short, std::string*, std::string*, std::string*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char*, int) in libupnpx.a(BasicHTTPServer_ObjC.o)
-[SSDPDBDevice_ObjC initWithCPPDevice:] in libupnpx.a(SSDPDB_ObjC.o)
SSDP::Search() in libupnpx.a(ssdp.o)
SSDPDB::DeleteDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPDB::DeleteDevicesByUuid(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPDB::GetDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
...
"std::string::length() const", referenced from:
SSDPDB::DeleteDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPDB::DeleteDevicesByUuid(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPDB::GetDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPDB::UpdateCacheControl(unsigned char*, unsigned int, int) in libupnpx.a(ssdpdb.o)
"std::string::compare(std::string const&) const", referenced from:
bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(httpsession.o)
bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
bool std::operator<<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in libupnpx.a(basichttpserver.o)
"std::allocator<char>::allocator()", referenced from:
SSDP::SSDP() in libupnpx.a(ssdp.o)
BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::allocator<char>::~allocator()", referenced from:
SSDP::SSDP() in libupnpx.a(ssdp.o)
BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::string::assign(char const*, unsigned long)", referenced from:
SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
SSDPDB::InsertDevice(unsigned char*, unsigned int) in libupnpx.a(ssdpdb.o)
SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::string::replace(unsigned long, unsigned long, char const*)", referenced from:
SSDPSearchResp::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpsearchresp.o)
SSDPNotifyAlive::Process(sockaddr*, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >) in libupnpx.a(ssdpnotifyalive.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
SSDP::SSDP() in libupnpx.a(ssdp.o)
BasicHTTPServer::DataReceived(sockaddr_in*, int, unsigned char*) in libupnpx.a(basichttpserver.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(httpsession.o)
std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
std::pair<std::string const, HTTPSession*>::pair(std::string const&, HTTPSession* const&) in libupnpx.a(basichttpserver.o)
std::pair<std::string const, HTTPSession*>::pair(std::pair<std::string const, HTTPSession*> const&) in libupnpx.a(basichttpserver.o)
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
HTTPSession::HTTPSession(char*, unsigned short) in libupnpx.a(httpsession.o)
HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(httpsession.o)
BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
___cxx_global_var_init in libupnpx.a(ssdp.o)
___cxx_global_var_init9 in libupnpx.a(ssdp.o)
...
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
HTTPSession::HTTPSession(char*, unsigned short) in libupnpx.a(httpsession.o)
HTTPSession::~HTTPSession() in libupnpx.a(httpsession.o)
HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::operator[](std::string const&) in libupnpx.a(httpsession.o)
std::pair<std::string const, std::string>::~pair() in libupnpx.a(httpsession.o)
std::pair<std::string const, std::string>::pair(std::string const&, std::string const&) in libupnpx.a(httpsession.o)
std::pair<std::string const, std::string>::pair(std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
...
"std::string::operator=(char const*)", referenced from:
HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
SSDP::SetOS(char const*) in libupnpx.a(ssdp.o)
SSDP::SetProduct(char const*) in libupnpx.a(ssdp.o)
SSDPDBDevice::SSDPDBDevice() in libupnpx.a(ssdpdbdevice.o)
"std::string::operator=(std::string const&)", referenced from:
HTTPSession::ParseHeader(unsigned char*, int) in libupnpx.a(httpsession.o)
BasicHTTPObserver_wrapper::Response(int*, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >*, char**, int*) in libupnpx.a(BasicHTTPServer_ObjC.o)
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator--() in libupnpx.a(httpsession.o)
std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator--() in libupnpx.a(BasicHTTPServer_ObjC.o)
std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator--() in libupnpx.a(basichttpserver.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
std::_Rb_tree_const_iterator<std::pair<std::string const, std::string> >::operator++(int) in libupnpx.a(BasicHTTPServer_ObjC.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator++() in libupnpx.a(httpsession.o)
std::_Rb_tree_iterator<std::pair<std::string const, std::string> >::operator++() in libupnpx.a(BasicHTTPServer_ObjC.o)
std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator++(int) in libupnpx.a(basichttpserver.o)
std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >::operator++() in libupnpx.a(basichttpserver.o)
"std::__throw_length_error(char const*)", referenced from:
std::vector<SSDPObserver*, std::allocator<SSDPObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPObserver**, std::vector<SSDPObserver*, std::allocator<SSDPObserver*> > >, SSDPObserver* const&) in libupnpx.a(ssdp.o)
std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDP_HTTP_HEADER**, std::vector<SSDP_HTTP_HEADER*, std::allocator<SSDP_HTTP_HEADER*> > >, SSDP_HTTP_HEADER* const&) in libupnpx.a(ssdpmessage.o)
std::vector<BasicHTTPObserver*, std::allocator<BasicHTTPObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<BasicHTTPObserver**, std::vector<BasicHTTPObserver*, std::allocator<BasicHTTPObserver*> > >, BasicHTTPObserver* const&) in libupnpx.a(basichttpserver.o)
std::vector<SocketServerConnection*, std::allocator<SocketServerConnection*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SocketServerConnection**, std::vector<SocketServerConnection*, std::allocator<SocketServerConnection*> > >, SocketServerConnection* const&) in libupnpx.a(socketserver.o)
std::vector<SocketServerObserver*, std::allocator<SocketServerObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SocketServerObserver**, std::vector<SocketServerObserver*, std::allocator<SocketServerObserver*> > >, SocketServerObserver* const&) in libupnpx.a(socketserver.o)
std::vector<SSDPDBObserver*, std::allocator<SSDPDBObserver*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPDBObserver**, std::vector<SSDPDBObserver*, std::allocator<SSDPDBObserver*> > >, SSDPDBObserver* const&) in libupnpx.a(ssdpdb.o)
std::vector<SSDPDBDevice*, std::allocator<SSDPDBDevice*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SSDPDBDevice**, std::vector<SSDPDBDevice*, std::allocator<SSDPDBDevice*> > >, SSDPDBDevice* const&) in libupnpx.a(ssdpdb.o)
...
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<std::string, std::pair<std::string const, HTTPSession*>, std::_Select1st<std::pair<std::string const, HTTPSession*> >, std::less<std::string>, std::allocator<std::pair<std::string const, HTTPSession*> > >::erase(std::_Rb_tree_iterator<std::pair<std::string const, HTTPSession*> >) in libupnpx.a(basichttpserver.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, std::string> const&) in libupnpx.a(httpsession.o)
std::_Rb_tree<std::string, std::pair<std::string const, std::string>, std::_Select1st<std::pair<std::string const, std::string> >, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, std::string> const&) in libupnpx.a(BasicHTTPServer_ObjC.o)
std::_Rb_tree<std::string, std::pair<std::string const, HTTPSession*>, std::_Select1st<std::pair<std::string const, HTTPSession*> >, std::less<std::string>, std::allocator<std::pair<std::string const, HTTPSession*> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<std::string const, HTTPSession*> const&) in libupnpx.a(basichttpserver.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know it's not really an answer, but I've ended up using Cocoapods to import the library.
Can't believe I haven't checked that it was available that way before !

Lots of: 'Apple Mach-O Linker Errors'

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.

Failure to build with Boost regex

I am quite new to C++ and I was trying to learn regular expressions using the Boost library. I am trying the following simple code.
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
/*
*
*/
int main()
{
const regex expression( "How to re" );
string string1 = "How to re";
bool match=regex_match(string1,expression);
if (match){
cout<<"Yes"<<endl;
}
return 0;
}
The problem is that a huge error is flagged when I try to run the file from the terminal.
The error flagged is the following:
Undefined symbols:
"boost::re_detail::get_mem_block()", referenced from:
boost::re_detail::save_state_init::save_state_init(boost::re_detail::saved_state**, boost::re_detail::saved_state**)in ccqa7fIw.o
boost::re_detail::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> > >::extend_stack()in ccqa7fIw.o
"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> > > > > >::maybe_assign(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> > > > > > const&)", referenced from:
boost::re_detail::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_match()in ccqa7fIw.o
"boost::re_detail::get_default_error_string(boost::regex_constants::error_type)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) constin ccqa7fIw.o
boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) constin ccqa7fIw.o
"boost::re_detail::put_mem_block(void*)", referenced from:
boost::re_detail::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> > >::unwind_extra_block(bool)in ccqa7fIw.o
boost::re_detail::save_state_init::~save_state_init()in ccqa7fIw.o
"boost::re_detail::raise_runtime_error(std::runtime_error 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::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)in ccqa7fIw.o
"boost::re_detail::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::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 ccqa7fIw.o
"boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const", referenced from:
boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) constin ccqa7fIw.o
"boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const", referenced from:
boost::cpp_regex_traits<char>::transform(char const*, char const*) constin ccqa7fIw.o
"boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)", referenced from:
boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)in ccqa7fIw.o
"boost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)", referenced from:
boost::re_detail::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_imp()in ccqa7fIw.o
"boost::re_detail::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 ccqa7fIw.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I really cannot understand what is going on here; I was also looking at examples of regex codes from other threads but couldn't find any solution. Can you please help me? Thanks!
You do not link with the Boost regex library, it's not header only but have a library you have to link with as well.
Try
$ c++ -I $PATH/boost_1_52_0 filename.cpp -o filename -L$PATH/to/libraries -lboost_regex
You have to set the path to the library as well, as you seem to use a custom built Boost.