Related
I've been trying to compile the following example program from the boost tutorial to create a logger all morning and can't work out what I'm doing wrong:
#include <boost/log/common.hpp>
#include <boost/log/sinks.hpp>
#include <boost/log/sources/severity_logger.hpp>
#include <boost/log/expressions.hpp>
#include <boost/core/null_deleter.hpp>
#include <boost/shared_ptr.hpp>
#include <iostream>
using namespace boost::log;
BOOST_LOG_ATTRIBUTE_KEYWORD(severity, "Severity", int)
int main()
{
typedef sinks::asynchronous_sink<sinks::text_ostream_backend> text_sink;
boost::shared_ptr<text_sink> sink = boost::make_shared<text_sink>();
boost::shared_ptr<std::ostream> stream{&std::clog,
boost::null_deleter{}};
sink->locked_backend()->add_stream(stream);
sink->set_filter(severity > 0);
sink->set_formatter(expressions::stream << severity << ": " <<
expressions::smessage);
core::get()->add_sink(sink);
sources::severity_logger<int> lg;
BOOST_LOG_SEV(lg, 0) << "note";
BOOST_LOG_SEV(lg, 1) << "warning";
BOOST_LOG_SEV(lg, 2) << "error";
sink->flush();
}
using the following commands:
clang -std=c++11 -c ./test.cpp -Wall -DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK
clang test.o -o test -DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK
And I'm met with a massive error message that ends like this:
vtable for boost::log::v2s_mt_posix::attribute::impl in test-7198fd.o
vtable for boost::detail::sp_counted_base in test-7198fd.o
vtable for boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char> in test-7198fd.o
vtable for boost::log::v2s_mt_posix::sinks::basic_sink_frontend in test-7198fd.o
vtable for boost::log::v2s_mt_posix::sinks::sink in test-7198fd.o
vtable for boost::detail::tss_cleanup_function in test-7198fd.o
...
"___cxa_rethrow", referenced from:
boost::detail::shared_count::shared_count<boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue>*, boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue> > >(boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue>*, boost::detail::sp_inplace_tag<boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue> > >) in test-7198fd.o
boost::log::v2s_mt_posix::sinks::basic_sink_frontend::will_consume(boost::log::v2s_mt_posix::attribute_value_set const&) in test-7198fd.o
boost::log::v2s_mt_posix::visitation_result boost::log::v2s_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::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::expressions::aux::stream_ref<boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::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::expressions::aux::stream_ref<boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&>) const in test-7198fd.o
boost::detail::shared_count::shared_count<boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::delete_data*, boost::detail::do_heap_delete<boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::delete_data> >(boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::delete_data*, boost::detail::do_heap_delete<boost::thread_specific_ptr<boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::delete_data>) in test-7198fd.o
boost::log::v2s_mt_posix::aux::threadsafe_queue<boost::log::v2s_mt_posix::record_view, std::__1::allocator<void> >::threadsafe_queue(std::__1::allocator<boost::log::v2s_mt_posix::aux::threadsafe_queue_types<boost::log::v2s_mt_posix::record_view, std::__1::allocator<void> >::node> const&) in test-7198fd.o
boost::detail::shared_count::shared_count<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>*, boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> > >(boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>*, boost::detail::sp_inplace_tag<boost::detail::sp_ms_deleter<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> > >) in test-7198fd.o
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::feed_record<boost::recursive_mutex, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char> >(boost::log::v2s_mt_posix::record_view const&, boost::recursive_mutex&, boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>&) in test-7198fd.o
...
"___cxa_throw", referenced from:
boost::log::v2s_mt_posix::aux::threadsafe_queue<boost::log::v2s_mt_posix::record_view, std::__1::allocator<void> >::threadsafe_queue(std::__1::allocator<boost::log::v2s_mt_posix::aux::threadsafe_queue_types<boost::log::v2s_mt_posix::record_view, std::__1::allocator<void> >::node> const&) in test-7198fd.o
void boost::throw_exception<boost::thread_resource_error>(boost::thread_resource_error const&) in test-7198fd.o
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::thread_resource_error> >::rethrow() const in test-7198fd.o
void boost::throw_exception<boost::lock_error>(boost::lock_error const&) in test-7198fd.o
boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >::rethrow() const in test-7198fd.o
void boost::throw_exception<boost::condition_error>(boost::condition_error const&) in test-7198fd.o
boost::detail::interruption_checker::check_for_interruption() in test-7198fd.o
...
"___gxx_personality_v0", referenced from:
_main in test-7198fd.o
boost::system::system_error::what() const in test-7198fd.o
boost::detail::sp_if_not_array<boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue> >::type boost::make_shared<boost::log::v2s_mt_posix::sinks::asynchronous_sink<boost::log::v2s_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2s_mt_posix::sinks::unbounded_fifo_queue> >() in test-7198fd.o
void boost::log::v2s_mt_posix::sinks::basic_sink_frontend::set_filter<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<int, boost::log::v2s_mt_posix::fallback_to_none, tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<int>, 0l> > >, 2l> > >(boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<int, boost::log::v2s_mt_posix::fallback_to_none, tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<int>, 0l> > >, 2l> > const&) in test-7198fd.o
void boost::log::v2s_mt_posix::sinks::basic_formatting_sink_frontend<char>::set_formatter<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<2> >, 0l> >, boost::log::v2s_mt_posix::expressions::attribute_actor<int, boost::log::v2s_mt_posix::fallback_to_none, tag::severity, boost::phoenix::actor> >, 2l> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<char [3]>, 0l> > >, 2l> >, boost::log::v2s_mt_posix::expressions::attribute_actor<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::expressions::tag::smessage, boost::phoenix::actor> >, 2l> > >(boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::phoenix::argument<2> >, 0l> >, boost::log::v2s_mt_posix::expressions::attribute_actor<int, boost::log::v2s_mt_posix::fallback_to_none, tag::severity, boost::phoenix::actor> >, 2l> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<char [3]>, 0l> > >, 2l> >, boost::log::v2s_mt_posix::expressions::attribute_actor<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::expressions::tag::smessage, boost::phoenix::actor> >, 2l> > const&) in test-7198fd.o
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger<int> >::stream() const in test-7198fd.o
boost::detail::shared_count::~shared_count() in test-7198fd.o
...
ld: symbol(s) not found for architecture x86_64
Boost was installed using:
brew install boost --c++11
Any ideas what's going on?
UPDATE
Having accidentally tried to compile the code in C as pointed out by gavinb, I've tried to recompile using the correct c++ compiler:
c++ -std=c++11 -c ./test.cpp -Wall -DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK
c++ test.o -o test -DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK -DBOOST_LOG_DYN_LINK
and now receive the following error:
st::thread_specific_ptr<boost::log::v2_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::get() const in test.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::v2_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::reset(boost::log::v2_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context*) in test.o
boost::thread_specific_ptr<boost::log::v2_mt_posix::sinks::basic_formatting_sink_frontend<char>::formatting_context>::~thread_specific_ptr() in test.o
"boost::detail::thread_data_base::~thread_data_base()", referenced from:
boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue> >, boost::_bi::list1<boost::_bi::value<boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue>*> > > >::~thread_data() in test.o
"boost::detail::get_current_thread_data()", referenced from:
boost::detail::interruption_checker::interruption_checker(_opaque_pthread_mutex_t*, _opaque_pthread_cond_t*) in test.o
"boost::system::system_category()", referenced from:
___cxx_global_var_init2 in test.o
boost::thread_exception::thread_exception(int, char const*) in test.o
boost::condition_error::condition_error(int, char const*) in test.o
"boost::system::generic_category()", referenced from:
___cxx_global_var_init in test.o
___cxx_global_var_init1 in test.o
"boost::thread::join_noexcept()", referenced from:
boost::thread::join() in test.o
"boost::thread::native_handle()", referenced from:
boost::thread::get_id() const in test.o
"boost::thread::start_thread_noexcept()", referenced from:
boost::thread::start_thread() in test.o
"boost::thread::detach()", referenced from:
boost::thread::~thread() in test.o
"boost::thread::thread()", referenced from:
boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue>::asynchronous_sink(bool) in test.o
"boost::log::v2_mt_posix::attribute_value_set::end() const", referenced from:
boost::log::v2_mt_posix::visitation_result boost::log::v2_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > >, boost::log::v2_mt_posix::fallback_to_none>::operator()<boost::log::v2_mt_posix::binder1st<boost::log::v2_mt_posix::output_fun, boost::log::v2_mt_posix::expressions::aux::stream_ref<boost::log::v2_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&> >(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&, boost::log::v2_mt_posix::binder1st<boost::log::v2_mt_posix::output_fun, boost::log::v2_mt_posix::expressions::aux::stream_ref<boost::log::v2_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&>) const in test.o
boost::log::v2_mt_posix::value_extractor<int, boost::log::v2_mt_posix::fallback_to_none, tag::severity>::operator()(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&) const in test.o
boost::log::v2_mt_posix::value_extractor<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::log::v2_mt_posix::fallback_to_none, boost::log::v2_mt_posix::expressions::tag::smessage>::operator()(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&) const in test.o
"boost::log::v2_mt_posix::attribute_value_set::find(boost::log::v2_mt_posix::attribute_name) const", referenced from:
boost::log::v2_mt_posix::visitation_result boost::log::v2_mt_posix::value_visitor_invoker<boost::mpl::vector2<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > >, boost::log::v2_mt_posix::fallback_to_none>::operator()<boost::log::v2_mt_posix::binder1st<boost::log::v2_mt_posix::output_fun, boost::log::v2_mt_posix::expressions::aux::stream_ref<boost::log::v2_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&> >(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&, boost::log::v2_mt_posix::binder1st<boost::log::v2_mt_posix::output_fun, boost::log::v2_mt_posix::expressions::aux::stream_ref<boost::log::v2_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&>) const in test.o
boost::log::v2_mt_posix::value_extractor<int, boost::log::v2_mt_posix::fallback_to_none, tag::severity>::operator()(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&) const in test.o
boost::log::v2_mt_posix::value_extractor<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::log::v2_mt_posix::fallback_to_none, boost::log::v2_mt_posix::expressions::tag::smessage>::operator()(boost::log::v2_mt_posix::attribute_name const&, boost::log::v2_mt_posix::attribute_value_set const&) const in test.o
"boost::log::v2_mt_posix::aux::once_block_sentry::enter_once_block() const", referenced from:
boost::log::v2_mt_posix::aux::once_block_sentry::executed() const in test.o
"boost::log::v2_mt_posix::core::get_logging_enabled() const", referenced from:
boost::log::v2_mt_posix::record boost::log::v2_mt_posix::sources::basic_composite_logger<char, boost::log::v2_mt_posix::sources::severity_logger<int>, boost::log::v2_mt_posix::sources::single_thread_model, boost::log::v2_mt_posix::sources::features<boost::log::v2_mt_posix::sources::severity<int> > >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::severity, int const> >(boost::parameter::aux::tagged_argument<boost::log::v2_mt_posix::keywords::tag::severity, int const> const&) in test.o
"boost::thread::joinable() const", referenced from:
boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue>::flush() in test.o
boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue>::stop() in test.o
"typeinfo for boost::detail::thread_data_base", referenced from:
typeinfo for boost::detail::thread_data<boost::_bi::bind_t<void, boost::_mfi::mf0<void, boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue> >, boost::_bi::list1<boost::_bi::value<boost::log::v2_mt_posix::sinks::asynchronous_sink<boost::log::v2_mt_posix::sinks::basic_text_ostream_backend<char>, boost::log::v2_mt_posix::sinks::unbounded_fifo_queue>*> > > > in test.o
"vtable for boost::detail::thread_data_base", referenced from:
boost::detail::thread_data_base::thread_data_base() in test.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)
Finally found a command that solved the problem:
clang++ -std=c++11 -DBOOST_LOG_DYN_LINK ./test.cpp -o test -lboost_log-mt -lpthread -lboost_thread-mt -lboost_system-mt
These symbols belong to the C++ runtime:
___cxa_throw
___gxx_personality_v0
When the linker complains these are missing, it is because you are linking the app as a C app rather than a C++ app.
Rather than invoking clang, just use c++ for both compiling and linking and it should work.
Some Boost libraries are header-only (being heavily templated), which means the implementation is completely provided by headers and thus does not require linking a separate library. But some Boost libraries (check the documentation as this is specifically noted) require linking a .so or .dylib for the implementation. This requires specifying the library name with the -l flag, such as -lboost_thread-mt and possibly the -L flag if the libraries aren't on your library path.
In your case, both the threading and logging libraries need their own libraries added to the link stage, and these also depend on the system library (a common/shared library). As you discovered, this means adding the following to the link phase:
-lpthread -lboost_log-mt -lboost_thread-mt -lboost_system-mt
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
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
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 installed cgal with macports:
$ sudo port install cgal
Then building my sample code with cmake:
$ cgal_create_CMakeLists -s out
$ cmake .
$ make
cmake returns succesfully with:
-- Requested component: MPFR
-- Requested component: GMP
-- Boost version: 1.54.0
-- Configuring done
-- Generating done
-- Build files have been written to: [...]
But as soon as I try to use the Exact_predicates_exact_constructions_kernel_with_sqrt kernel in my .cpp file, make fails in the linking stage with the following error. Exact_predicates_exact_constructions_kernel works fine.
Linking CXX executable out
Undefined symbols for architecture x86_64:
"CORE::EscapePrec", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::core_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, int, bool)", referenced from:
CORE::filteredFp::operator/(CORE::filteredFp const&) const in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::filteredFp::sqrt() const in hello-really-exact.cpp.o
"CORE::defAbsPrec", referenced from:
CORE::Real::Real(CORE::BigRat const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::BigFloatValue() const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::sqrt(CORE::extLong const&) const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::sqrt(CORE::extLong const&, CORE::BigFloat const&) const in hello-really-exact.cpp.o
"CORE::defRelPrec", referenced from:
CORE::Real::Real(CORE::BigRat const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::BigFloatValue() const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::sqrt(CORE::extLong const&) const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::sqrt(CORE::extLong const&, CORE::BigFloat const&) const in hello-really-exact.cpp.o
"CORE::BigFloatRep::add(CORE::BigFloatRep const&, CORE::BigFloatRep const&)", referenced from:
CORE::Real CORE::_real_add::eval<CORE::BigFloat>(CORE::BigFloat const&, CORE::BigFloat const&) in hello-really-exact.cpp.o
"CORE::BigFloatRep::div(CORE::BigInt const&, CORE::BigInt const&, CORE::extLong const&, CORE::extLong const&)", referenced from:
CORE::BigFloat::approx(CORE::BigRat const&, CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::BigFloat::BigFloat(CORE::BigRat const&, CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
"CORE::BigFloatRep::sub(CORE::BigFloatRep const&, CORE::BigFloatRep const&)", referenced from:
CORE::Real CORE::_real_sub::eval<CORE::BigFloat>(CORE::BigFloat const&, CORE::BigFloat const&) in hello-really-exact.cpp.o
"CORE::BigFloatRep::sqrt(CORE::BigFloatRep const&, CORE::extLong const&)", referenced from:
CORE::BigFloat::sqrt(CORE::extLong const&) const in hello-really-exact.cpp.o
"CORE::BigFloatRep::sqrt(CORE::BigFloatRep const&, CORE::extLong const&, CORE::BigFloat const&)", referenced from:
CORE::BigFloat::sqrt(CORE::extLong const&, CORE::BigFloat const&) const in hello-really-exact.cpp.o
"CORE::BigFloatRep::trunc(CORE::BigInt const&, CORE::extLong const&, CORE::extLong const&)", referenced from:
CORE::Realbase_for<long>::approx(CORE::extLong const&, CORE::extLong const&) const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigInt>::approx(CORE::extLong const&, CORE::extLong const&) const in hello-really-exact.cpp.o
"CORE::BigFloatRep::approx(CORE::BigFloatRep const&, CORE::extLong const&, CORE::extLong const&)", referenced from:
CORE::Realbase_for<CORE::BigFloat>::approx(CORE::extLong const&, CORE::extLong const&) const in hello-really-exact.cpp.o
"CORE::InvalidFlag", referenced from:
CORE::sqrt(CORE::Expr const&) in hello-really-exact.cpp.o
CORE::operator/(CORE::Expr const&, CORE::Expr const&) in hello-really-exact.cpp.o
"CORE::fpFilterFlag", referenced from:
CORE::filteredFp::isOK() const in hello-really-exact.cpp.o
"CORE::EscapePrecFlag", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::EscapePrecWarning", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::rationalReduceFlag", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::progressiveEvalFlag", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::defInitialProgressivePrec", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::Add::name", referenced from:
CORE::AddSubRep<CORE::Add>::op() const in hello-really-exact.cpp.o
"CORE::Sub::name", referenced from:
CORE::AddSubRep<CORE::Sub>::op() const in hello-really-exact.cpp.o
"CORE::clLg(long)", referenced from:
CORE::Realbase_for<long>::length() const in hello-really-exact.cpp.o
CORE::Realbase_for<long>::height() const in hello-really-exact.cpp.o
"CORE::clLg(unsigned long)", referenced from:
CORE::Realbase_for<long>::ULV_E(CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&) const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigFloat>::clLgErr() const in hello-really-exact.cpp.o
"CORE::flrLg(long)", referenced from:
CORE::Real::Real(long) in hello-really-exact.cpp.o
"CORE::flrLg(unsigned long)", referenced from:
CORE::_real_binary_op<CORE::_real_add>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigFloat>::flrLgErr() const in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_sub>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
"CORE::ExprRep::degreeBound()", referenced from:
CORE::sqrt(CORE::Expr const&) in hello-really-exact.cpp.o
CORE::operator/(CORE::Expr const&, CORE::Expr const&) in hello-really-exact.cpp.o
CORE::Expr::cmp(CORE::Expr const&) const in hello-really-exact.cpp.o
"CORE::ExprRep::getAppValue(CORE::extLong const&, CORE::extLong const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
"CORE::ExprRep::computeBound()", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::ExprRep::reduceToZero()", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::ExprRep::reduceToBigRat(CORE::BigRat const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::ExprRep::reduceTo(CORE::ExprRep const*)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::ExprRep::ExprRep()", referenced from:
CORE::DivRep::DivRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
CORE::MultRep::MultRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::AddSubRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
CORE::Expr::operator-() const in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::AddSubRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
CORE::Expr::Expr(int) in hello-really-exact.cpp.o
CORE::Expr::Expr() in hello-really-exact.cpp.o
...
"CORE::extLong::getNegInfty()", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_add>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
CORE::Real::Real(long) in hello-really-exact.cpp.o
CORE::Realbase_for<long>::flrLgErr() const in hello-really-exact.cpp.o
CORE::Realbase_for<long>::clLgErr() const in hello-really-exact.cpp.o
CORE::Real::Real(CORE::BigInt const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigInt>::flrLgErr() const in hello-really-exact.cpp.o
...
"CORE::extLong::getPosInfty()", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_add>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_sub>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
"CORE::extLong::operator-=(CORE::extLong const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigRat>::ULV_E(CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&, CORE::extLong&) const in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
"CORE::extLong::operator*=(CORE::extLong const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
"CORE::extLong::operator+=(CORE::extLong const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_add>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
CORE::Real::Real(CORE::BigRat const&) in hello-really-exact.cpp.o
CORE::Real::Real(CORE::BigFloat const&) in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigFloat>::flrLgErr() const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigFloat>::clLgErr() const in hello-really-exact.cpp.o
...
"CORE::BinOpRep::initNodeInfo()", referenced from:
vtable for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
vtable for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"CORE::BinOpRep::count()", referenced from:
vtable for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
vtable for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"CORE::BinOpRep::clearFlag()", referenced from:
vtable for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
vtable for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"CORE::io_write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, __mpq_struct const*)", referenced from:
CORE::Realbase_for<CORE::BigRat>::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in hello-really-exact.cpp.o
"CORE::io_write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, __mpz_struct const*)", referenced from:
CORE::Realbase_for<CORE::BigInt>::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in hello-really-exact.cpp.o
"CORE::AbortFlag", referenced from:
CORE::sqrt(CORE::Expr const&) in hello-really-exact.cpp.o
CORE::operator/(CORE::Expr const&, CORE::Expr const&) in hello-really-exact.cpp.o
"CORE::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, CORE::extLong const&)", referenced from:
CORE::AddSubRep<CORE::Add>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Add>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeExactFlags() in hello-really-exact.cpp.o
CORE::AddSubRep<CORE::Sub>::computeApproxValue(CORE::extLong const&, CORE::extLong const&) in hello-really-exact.cpp.o
"CORE::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, CORE::ExprRep&)", referenced from:
_main in hello-really-exact.cpp.o
"CORE::BigFloatRep::compareMExp(CORE::BigFloatRep const&) const", referenced from:
CORE::BigFloat::longValue() const in hello-really-exact.cpp.o
"CORE::BigFloatRep::toLong() const", referenced from:
CORE::BigFloat::longValue() const in hello-really-exact.cpp.o
"CORE::BigFloatRep::toBigInt() const", referenced from:
CORE::Realbase_for<CORE::BigFloat>::BigIntValue() const in hello-really-exact.cpp.o
"CORE::BigFloatRep::toDouble() const", referenced from:
CORE::Realbase_for<CORE::BigFloat>::doubleValue() const in hello-really-exact.cpp.o
"CORE::BigFloatRep::toDecimal(unsigned int, bool) const", referenced from:
CORE::Realbase_for<CORE::BigFloat>::toString(long, bool) const in hello-really-exact.cpp.o
CORE::Realbase_for<CORE::BigFloat>::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in hello-really-exact.cpp.o
"CORE::extLong::operator-() const", referenced from:
CORE::_real_binary_op<CORE::_real_add>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
CORE::_real_binary_op<CORE::_real_sub>::eval(CORE::RealRep const&, CORE::RealRep const&) in hello-really-exact.cpp.o
"CORE::BinOpRep::debugList(int, int) const", referenced from:
vtable for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
vtable for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"CORE::BinOpRep::debugTree(int, int, int) const", referenced from:
vtable for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
vtable for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"typeinfo for CORE::BinOpRep", referenced from:
typeinfo for CORE::AddSubRep<CORE::Add> in hello-really-exact.cpp.o
typeinfo for CORE::AddSubRep<CORE::Sub> in hello-really-exact.cpp.o
"vtable for CORE::UnaryOpRep", referenced from:
CORE::UnaryOpRep::~UnaryOpRep() in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::ConstDoubleRep", referenced from:
CORE::Expr::Expr(int) in hello-really-exact.cpp.o
CORE::Expr::Expr() in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::DivRep", referenced from:
CORE::DivRep::DivRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::NegRep", referenced from:
CORE::Expr::operator-() const in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::MultRep", referenced from:
CORE::MultRep::MultRep(CORE::ExprRep*, CORE::ExprRep*) in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::SqrtRep", referenced from:
CORE::SqrtRep::SqrtRep(CORE::ExprRep*) in hello-really-exact.cpp.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for CORE::BinOpRep", referenced from:
CORE::BinOpRep::~BinOpRep() in hello-really-exact.cpp.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]: *** [out] Error 1
make[1]: *** [CMakeFiles/out.dir/all] Error 2
make: *** [all] Error 2
I'm on Mac OS X 10.9.0
As explained in the installation documentation, cgal_create_CMakeLists takes arguments to specify the CGAL and BOOST components it should link with. In this case, you want -c Core. The automatic detection of which components are needed is fairly limited, so you usually need to specify them yourself.
$ cgal_create_CMakeLists -c Core -s out
$ cmake .
$ make
An alternative way is to create a file called cgal_cmake_options in the same directory, or a file called .cgal_cmake_options_rc in your home directory, which contains:
CGAL_COMPONENT Core
Note that the script does not accumulate the options if you use several of those methods.