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
Related
On Linux machine, my code could build successfully.
However, on my Mac, the same command cannot build unless I take out this part:
void split_is(const std::string &s, string delim_regex, std::vector<std::string> &elems) {
// Terribly slow and inefficient, sorry. Should probably fix this at some point
boost::algorithm::split_regex(elems, s, regex(delim_regex));
std::vector<std::string> non_zero_elems;
for(int e = 0; e < elems.size(); e++){
if (elems[e].length() > 0){
non_zero_elems.push_back(elems[e]);
}
}
elems = non_zero_elems; }
The command I used is:
g++ -lboost_regex -lgurobi_c++ -lgurobi60 -stdlib=libstdc++ -lpthread
-lm -Wall -m64 -fPIE -fexceptions -frounding-math -O2 -I/Library/gurobi604/mac64/include/ -I/usr/local/include/ -L/Library/gurobi604/mac64/lib/ -L/usr/local/lib/ main.cpp tools.cpp treeofdevil.cpp solver.cpp periodicfunction.cpp -o ising.exe /usr/local/lib/libboost_regex.a
Does anyone know what might possibly go wrong? Thank you.
The error I get is:
Undefined symbols for architecture x86_64:
"boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > > const&)", referenced from:
boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_prefix() in tools-9bd02e.o
boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match() in tools-9bd02e.o
"boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)", referenced from:
boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::string>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::string>) in tools-9bd02e.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(char const*) const", referenced from:
unsigned int boost::re_detail::find_sort_syntax<boost::re_detail::cpp_regex_traits_implementation<char>, char>(boost::re_detail::cpp_regex_traits_implementation<char> const*, char*) in libboost_regex.a(instances.o)
char const* boost::re_detail::re_is_set_member<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char const*, char const*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
char* boost::re_detail::re_is_set_member<char*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char*, char*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
void std::__1::vector<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > >, std::__1::allocator<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > > >::__push_back_slow_path<boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > const>(boost::re_detail::recursion_info<boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > > > const&) in libboost_regex.a(instances.o)
std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::vector(std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > > const&) in libboost_regex.a(instances.o)
std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::insert(std::__1::__wrap_iter<boost::sub_match<char const*> const*>, unsigned long, boost::sub_match<char const*> const&) in libboost_regex.a(instances.o)
std::__1::enable_if<(__is_forward_iterator<boost::sub_match<char const*>*>::value) && (is_constructible<boost::sub_match<char const*>, std::__1::iterator_traits<boost::sub_match<char const*>*>::reference>::value), void>::type std::__1::vector<boost::sub_match<char const*>, std::__1::allocator<boost::sub_match<char const*> > >::assign<boost::sub_match<char const*>*>(boost::sub_match<char const*>*, boost::sub_match<char const*>*) in libboost_regex.a(instances.o)
std::__1::vector<bool, std::__1::allocator<bool> >::assign(unsigned long, bool const&) in libboost_regex.a(instances.o)
std::__1::vector<bool, std::__1::allocator<bool> >::reserve(unsigned long) in libboost_regex.a(instances.o)
void std::__1::vector<std::__1::pair<bool, boost::re_detail::re_syntax_base*>, std::__1::allocator<std::__1::pair<bool, boost::re_detail::re_syntax_base*> > >::__push_back_slow_path<std::__1::pair<bool, boost::re_detail::re_syntax_base*> const>(std::__1::pair<bool, boost::re_detail::re_syntax_base*> const&) in libboost_regex.a(instances.o)
...
"std::__1::__vector_base_common<true>::__throw_out_of_range() const", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_open_paren() in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_perl_extension() in libboost_regex.a(instances.o)
"std::__1::__basic_string_common<true>::__throw_length_error() const", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname_imp(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_classname(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::ios_base::getloc() const", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::logic_error::logic_error(char const*)", referenced from:
boost::match_results<char const*, std::__1::allocator<boost::sub_match<char const*> > >::raise_logic_error() in libboost_regex.a(instances.o)
"std::logic_error::logic_error(char const*)", referenced from:
boost::re_detail::perl_matcher<char const*, std::__1::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags) in libboost_regex.a(instances.o)
"std::logic_error::logic_error(std::logic_error const&)", referenced from:
void boost::throw_exception<std::invalid_argument>(std::invalid_argument const&) in libboost_regex.a(instances.o)
void boost::throw_exception<std::logic_error>(std::logic_error const&) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::rethrow() const in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_impl(boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> > const&, boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_tag) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::logic_error> >::clone_impl(boost::exception_detail::error_info_injector<std::logic_error> const&) in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::rethrow() const in libboost_regex.a(instances.o)
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::clone_impl(boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> > const&, boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::invalid_argument> >::clone_tag) in libboost_regex.a(instances.o)
...
"std::runtime_error::runtime_error(char const*)", referenced from:
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned long) in libboost_regex.a(instances.o)
"std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, ...
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::append_set(boost::re_detail::basic_char_set<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, mpl_::bool_<false>*) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, long) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(unsigned long, char)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*, unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(unsigned long, char)", referenced from:
char const* boost::re_detail::re_is_set_member<char const*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char const*, char const*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
char* boost::re_detail::re_is_set_member<char*, char, boost::regex_traits<char, boost::cpp_regex_traits<char> >, unsigned int>(char*, char*, boost::re_detail::re_set_long<unsigned int> const*, boost::re_detail::regex_data<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, bool) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::insert(std::__1::__wrap_iter<char const*>, char)", referenced from:
boost::re_detail::basic_regex_creator<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::append_set(boost::re_detail::basic_char_set<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, mpl_::bool_<false>*) in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__grow_by(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::lookup_collatename(char const*, char const*) const in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::catalog_name(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::get_catalog_name() in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse(char const*, char const*, unsigned int) in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::fail(boost::regex_constants::error_type, long) in libboost_regex.a(instances.o)
boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::parse_extended() in libboost_regex.a(instances.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const in libboost_regex.a(instances.o)
boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const in libboost_regex.a(instances.o)
.....const in libboost_regex.a(instances.o)
boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::imbue(std::__1::locale) in libboost_regex.a(instances.o)
boost::cpp_regex_traits<char>::imbue(std::__1::locale) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>, boost::re_detail::cpp_regex_traits_implementation<char> >::do_get(boost::re_detail::cpp_regex_traits_base<char> const&, unsigned long) in libboost_regex.a(instances.o)
unsigned long std::__1::__tree<std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> >, std::__1::__map_value_compare<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> >, std::__1::less<boost::re_detail::cpp_regex_traits_base<char> >, true>, std::__1::allocator<std::__1::__value_type<boost::re_detail::cpp_regex_traits_base<char>, std::__1::__list_iterator<std::__1::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const>, boost::re_detail::cpp_regex_traits_base<char> const*>, void*> > > >::__erase_unique<boost::re_detail::cpp_regex_traits_base<char> >(boost::re_detail::cpp_regex_traits_base<char> const&) in libboost_regex.a(instances.o)
...
"std::__1::locale::operator=(std::__1::locale const&)", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::collate<char>::id", referenced from:
boost::re_detail::cpp_regex_traits_base<char>::imbue(std::__1::locale const&) in libboost_regex.a(instances.o)
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> const> boost::re_detail::create_cpp_regex_traits<char>(std::__1::locale const&) in libboost_regex.a(instances.o)
"std::__1::ios_base::init(void*)", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::ios_base::clear(unsigned int)", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::numpunct<char>::id", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"std::__1::basic_ios<char, std::__1::char_traits<char> >::~basic_ios()", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
"typeinfo for std::__1::basic_streambuf<char, std::__1::char_traits<char> >", referenced from:
typeinfo for boost::re_detail::parser_buf<char, std::__1::char_traits<char> > in libboost_regex.a(instances.o)
"vtable for std::__1::basic_istream<char, std::__1::char_traits<char> >", referenced from:
boost::cpp_regex_traits<char>::toi(char const*&, char const*, int) const in libboost_regex.a(instances.o)
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I suspect that you have more than one thing going on here; moving -lboost_regex should solve some of them.
I suspect that the main problem you have is that you've built part of your program (the boost libraries, probably) with libc++, and the rest with libstdc++.
Your build command explicitly says -stdlib=libstdc++, but the error message mentions std::__1::...., which is where things live in libc++.
I have successfully installed and tested HealPix 3.11 on my MacBookPro running OS X 10.9.2.
In the configure script I have chosen 'cxx' and 'osx'.
Now I'm trying to link to the HealPix libraries in a C++ program and get the following linking errors:
make
g++ -o./test.o -I/Users/kruip/Software/Bonn/plugins/Healpix_3.11/src/cxx/osx/include -c test.cpp
g++ test.o -o test -lm -L/Users/kruip/Software/Bonn/plugins/Healpix_3.11/src/cxx/osx/lib -lhealpix_cxx -lgslcblas -lgsl
Undefined symbols for architecture x86_64:
"equal_nocase(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&)", referenced from:
string2HealpixScheme(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libhealpix_cxx.dylib(healpix_tables.o)
"planck_failure__(char const*, int, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
string2HealpixScheme(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libhealpix_cxx.dylib(healpix_tables.o)
"planck_failure__(char const*, int, char const*, char const*)", referenced from:
T_Healpix_Base<int>::query_multidisc_general(arr<vec3_t<double> > const&, arr<double> const&, bool, std::__1::vector<int, std::__1::allocator<int> > const&, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::Set(int, Healpix_Ordering_Scheme) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::query_strip_internal(double, double, bool, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
rangeset<int>::append(int const&, int const&) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::xyf2ring(int, int, int) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::loc2pix(double, double, double, bool) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::pix2loc(int, double&, double&, double&, bool&) const in libhealpix_cxx.dylib(healpix_base.o)
...
"find_enclosing_circle(arr<vec3_t<double> > const&, vec3_t<double>&, double&)", referenced from:
void T_Healpix_Base<int>::query_polygon_internal<int>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_polygon_internal<int>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_polygon_internal<long>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<long>&) const in libhealpix_cxx.dylib(healpix_base.o)
"trim(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
string2HealpixScheme(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libhealpix_cxx.dylib(healpix_tables.o)
"PlanckError::PlanckError(char const*)", referenced from:
T_Healpix_Base<int>::query_multidisc_general(arr<vec3_t<double> > const&, arr<double> const&, bool, std::__1::vector<int, std::__1::allocator<int> > const&, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::Set(int, Healpix_Ordering_Scheme) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::query_strip_internal(double, double, bool, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
rangeset<int>::append(int const&, int const&) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::xyf2ring(int, int, int) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::loc2pix(double, double, double, bool) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::pix2loc(int, double&, double&, double&, bool&) const in libhealpix_cxx.dylib(healpix_base.o)
...
"PlanckError::PlanckError(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
string2HealpixScheme(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libhealpix_cxx.dylib(healpix_tables.o)
"PlanckError::~PlanckError()", referenced from:
T_Healpix_Base<int>::query_multidisc_general(arr<vec3_t<double> > const&, arr<double> const&, bool, std::__1::vector<int, std::__1::allocator<int> > const&, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::Set(int, Healpix_Ordering_Scheme) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::query_strip_internal(double, double, bool, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
rangeset<int>::append(int const&, int const&) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::xyf2ring(int, int, int) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::loc2pix(double, double, double, bool) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::pix2loc(int, double&, double&, double&, bool&) const in libhealpix_cxx.dylib(healpix_base.o)
...
"pointing::from_vec3(vec3_t<double> const&)", referenced from:
void T_Healpix_Base<long>::query_multidisc<long>(arr<vec3_t<double> > const&, arr<double> const&, int, rangeset<long>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_multidisc<int>(arr<vec3_t<double> > const&, arr<double> const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<int>::query_multidisc<int>(arr<vec3_t<double> > const&, arr<double> const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
"pointing::normalize()", referenced from:
void T_Healpix_Base<int>::query_disc_internal<int>(pointing, double, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_disc_internal<int>(pointing, double, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_disc_internal<long>(pointing, double, int, rangeset<long>&) const in libhealpix_cxx.dylib(healpix_base.o)
"pointing::to_vec3() const", referenced from:
void T_Healpix_Base<int>::query_disc_internal<int>(pointing, double, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_disc_internal<int>(pointing, double, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<int>::query_polygon_internal<int>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_polygon_internal<int>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_disc_internal<long>(pointing, double, int, rangeset<long>&) const in libhealpix_cxx.dylib(healpix_base.o)
void T_Healpix_Base<long>::query_polygon_internal<long>(std::__1::vector<pointing, std::__1::allocator<pointing> > const&, int, rangeset<long>&) const in libhealpix_cxx.dylib(healpix_base.o)
"typeinfo for PlanckError", referenced from:
T_Healpix_Base<int>::query_multidisc_general(arr<vec3_t<double> > const&, arr<double> const&, bool, std::__1::vector<int, std::__1::allocator<int> > const&, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::Set(int, Healpix_Ordering_Scheme) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::query_strip_internal(double, double, bool, rangeset<int>&) const in libhealpix_cxx.dylib(healpix_base.o)
rangeset<int>::append(int const&, int const&) in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::xyf2ring(int, int, int) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::loc2pix(double, double, double, bool) const in libhealpix_cxx.dylib(healpix_base.o)
T_Healpix_Base<int>::pix2loc(int, double&, double&, double&, bool&) const in libhealpix_cxx.dylib(healpix_base.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [test] Error 1
This test code reproduces my problems:
#include "healpix_base.h"
int main(void){
Healpix_Base healpix_base_ref(5,RING);
return 0;
}
and my Makefile looks like this:
PLUGINS = /Users/kruip/Software/Bonn/plugins
HEALPIX_PATH = $(PLUGINS)/Healpix_3.11/src/cxx/osx
#COMP = /usr/local/bin/mpic++
COMP = g++
FLAGS =
MYLIBS = -L${HEALPIX_PATH}/lib -lhealpix_cxx
MYINCLUDE = -I${HEALPIX_PATH}/include
OBJS = test.o
all: test
test: ${OBJS}
${COMP} ${OBJS} -o test ${FLAGS} -lm $(MYLIBS) -lgslcblas -lgsl
test.o: test.cpp
${COMP} -o./test.o ${MYINCLUDE} -c test.cpp ${FLAGS}
clean:
rm -rf test.o test
Suggestions are very welcome at this point!
Fixed it by including the following linker invokations: -lhealpix_cxx -lcxxsupport -lsharp -lfftpack -lc_utils -lcfitsio
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 !
How can one use logging library from Boost on version 1.54 ? (I'm using QtCreator and have successfully used boost/filesystem)
I read that the logging lib is now part of Boost, but I can't make it work on MacOs:
My .pro file:
#-------------------------------------------------
#
# Project created by QtCreator 2013-10-30T14:34:26
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Fottopic
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
configwindow.cpp \
windowmanager.cpp
HEADERS += mainwindow.h \
configwindow.h \
windowmanager.h
INCLUDEPATH += /usr/local/Cellar/boost/1.54.0/include
QMAKE_LIBDIR += /usr/local/Cellar/boost/1.54.0/lib
LIBS += -lboost_system\
-lboost_filesystem\
-lboost_log\
-lboost_log_setup
Output when building:
Undefined symbols for architecture x86_64:
"boost::log::v2s_mt_posix::sinks::text_file_backend::~text_file_backend()", referenced from:
boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::text_file_backend>::destroy() in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::construct(boost::filesystem::path const&, std::_Ios_Openmode, unsigned long, boost::log::v2s_mt_posix::aux::light_function<bool ()()> const&, bool)", referenced from:
void boost::log::v2s_mt_posix::sinks::text_file_backend::construct<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::flush()", referenced from:
void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::flush_backend_impl<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&, mpl_::bool_<true>)in main.o
"boost::detail::get_tss_data(void const*)", referenced from:
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::get() constin main.o
"boost::detail::set_tss_data(void const*, boost::shared_ptr<boost::detail::tss_cleanup_function>, void*, bool)", referenced from:
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::reset(boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context*)in main.o
boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::~thread_specific_ptr()in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::consume(boost::log::v2s_mt_posix::record_view const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::log::v2s_mt_posix::aux::fake_mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::log::v2s_mt_posix::aux::fake_mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)in main.o
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::mutex, boost::log::v2s_mt_posix::sinks::text_file_backend>(boost::log::v2s_mt_posix::record_view const&, boost::mutex&, boost::log::v2s_mt_posix::sinks::text_file_backend&)in main.o
"boost::log::v2s_mt_posix::aux::default_attribute_names::message()", referenced from:
boost::log::v2s_mt_posix::expressions::tag::message::get_name() in main.o
"boost::log::v2s_mt_posix::aux::code_convert(wchar_t const*, unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::locale const&)", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >& boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >::formatted_write<wchar_t>(wchar_t const*, long)in main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::enter_once_block() const", referenced from:
boost::log::v2s_mt_posix::aux::once_block_sentry::executed() constin main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::rollback()", referenced from:
boost::log::v2s_mt_posix::aux::once_block_sentry::~once_block_sentry()in main.o
"boost::log::v2s_mt_posix::aux::once_block_sentry::commit()", referenced from:
boost::array<std::pair<boost::log::v2s_mt_posix::type_info_wrapper, void*>, 2ul> const& boost::log::v2s_mt_posix::aux::type_sequence_dispatcher<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >::get_dispatching_map<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >()in main.o
"boost::log::v2s_mt_posix::attribute_value_set::find(boost::log::v2s_mt_posix::attribute_name) const", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::attribute_value_set::end() const", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::aux::attach_attribute_name_info(boost::exception&, boost::log::v2s_mt_posix::attribute_name const&)", referenced from:
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >, boost::log::v2s_mt_posix::fallback_to_none>::operator()<boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&> >(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&, boost::log::v2s_mt_posix::binder1st<boost::log::v2s_mt_posix::output_fun, boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::char_traits<char>, std::allocator<char> >&>) constin main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::set_file_collector(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::file::collector> const&)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::sinks::text_file_backend::scan_for_files(boost::log::v2s_mt_posix::sinks::file::scan_method, bool)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::core::get()", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
"boost::log::v2s_mt_posix::core::add_sink(boost::shared_ptr<boost::log::v2s_mt_posix::sinks::sink> const&)", referenced from:
boost::shared_ptr<boost::log::v2s_mt_posix::sinks::synchronous_sink<boost::log::v2s_mt_posix::sinks::text_file_backend> > boost::log::v2s_mt_posix::aux::add_file_log<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::file_name, char const [11]> const&)in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [Fottopic.app/Contents/MacOS/Fottopic] Error 1
17:48:19: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Fottopic (kit: Desktop)
When executing step 'Make'
I 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.