CGAL Linking Error on Mac OS X - c++

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.

Related

C++ git repo compile trouble

I've just downloaded this repo: UCTDom
And opening the project in Clion from the /UCTDom-master dir, or attempting to make from /UCTDom-master/Console4SimpleStorage/Console4SimpleStorage results in this missing architecture error:
Undefined symbols for architecture x86_64:
"BigMoneyAI::~BigMoneyAI()", referenced from:
Player::~Player() in main-cd1c38.o
"FlatUCBMod::~FlatUCBMod()", referenced from:
Player::~Player() in main-cd1c38.o
"HumanInputAI::~HumanInputAI()", referenced from:
Player::~Player() in main-cd1c38.o
"DoubleWitchAI::~DoubleWitchAI()", referenced from:
Player::~Player() in main-cd1c38.o
"SingleWitchAI::~SingleWitchAI()", referenced from:
Player::~Player() in main-cd1c38.o
"UCTMonteCarlo::~UCTMonteCarlo()", referenced from:
Player::~Player() in main-cd1c38.o
"Game::initialize()", referenced from:
playGame(Game&) in main-cd1c38.o
"Game::writeCSVLog(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
_main in main-cd1c38.o
"Game::writeToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
writeToFile(Game&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in main-cd1c38.o
"Game::writeMoveHistoryToFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)", referenced from:
_main in main-cd1c38.o
"Game::play()", referenced from:
playGame(Game&) in main-cd1c38.o
"Game::Game()", referenced from:
_main in main-cd1c38.o
"FlatUCB::~FlatUCB()", referenced from:
Player::~Player() in main-cd1c38.o
"RandomAI::~RandomAI()", referenced from:
Player::~Player() in main-cd1c38.o
"GameState::~GameState()", referenced from:
Game::~Game() in main-cd1c38.o
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in main-cd1c38.o
"std::__1::ios_base::getloc() const", referenced from:
std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in main-cd1c38.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long, unsigned long)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in main-cd1c38.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(unsigned long, char) in main-cd1c38.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in main-cd1c38.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:
writeToFile(Game&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in main-cd1c38.o
_main in main-cd1c38.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
writeToFile(Game&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in main-cd1c38.o
_main in main-cd1c38.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in main-cd1c38.o
Game::~Game() in main-cd1c38.o
Move::~Move() in main-cd1c38.o
std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in main-cd1c38.o
"std::__1::basic_istream<char, std::__1::char_traits<char> >::operator>>(int&)", referenced from:
_main in main-cd1c38.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in main-cd1c38.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in main-cd1c38.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in main-cd1c38.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in main-cd1c38.o
"std::__1::cin", referenced from:
_main in main-cd1c38.o
"std::__1::cout", referenced from:
playGame(Game&) in main-cd1c38.o
_main in main-cd1c38.o
"std::__1::ctype<char>::id", referenced from:
std::__1::ctype<char> const& std::__1::use_facet<std::__1::ctype<char> >(std::__1::locale const&) in main-cd1c38.o
"std::__1::locale::~locale()", referenced from:
std::__1::basic_ios<char, std::__1::char_traits<char> >::widen(char) const in main-cd1c38.o
"std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in main-cd1c38.o
"std::__1::ios_base::clear(unsigned int)", referenced from:
std::__1::ios_base::setstate(unsigned int) in main-cd1c38.o
"std::__1::to_string(int)", referenced from:
_main in main-cd1c38.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
_main in main-cd1c38.o
"std::terminate()", referenced from:
___clang_call_terminate in main-cd1c38.o
"operator delete(void*)", referenced from:
_main in main-cd1c38.o
std::__1::_DeallocateCaller::__do_call(void*) in main-cd1c38.o
"operator new(unsigned long)", referenced from:
_main in main-cd1c38.o
"___cxa_begin_catch", referenced from:
___clang_call_terminate in main-cd1c38.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in main-cd1c38.o
"___cxa_call_unexpected", referenced from:
std::__1::__vector_base<Move, std::__1::allocator<Move> >::__destruct_at_end(Move*) in main-cd1c38.o
std::__1::allocator<Move>::deallocate(Move*, unsigned long) in main-cd1c38.o
std::__1::__vector_base<LogItem, std::__1::allocator<LogItem> >::__destruct_at_end(LogItem*) in main-cd1c38.o
std::__1::allocator<LogItem>::deallocate(LogItem*, unsigned long) in main-cd1c38.o
std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >::ostreambuf_iterator(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in main-cd1c38.o
"___cxa_end_catch", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in main-cd1c38.o
"___gxx_personality_v0", referenced from:
writeToFile(Game&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in main-cd1c38.o
_main in main-cd1c38.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > std::__1::operator+<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) in main-cd1c38.o
Game::~Game() in main-cd1c38.o
std::__1::__vector_base<Move, std::__1::allocator<Move> >::__destruct_at_end(Move*) in main-cd1c38.o
std::__1::allocator<Move>::deallocate(Move*, unsigned long) in main-cd1c38.o
std::__1::__vector_base<LogItem, std::__1::allocator<LogItem> >::__destruct_at_end(LogItem*) in main-cd1c38.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: *** [main.o] Error 1
Process finished with exit code 2
I have figured out that perhaps the undefined deconstructors is an aspect of this, but it seems to me that this would have been a problem to the creators of the repo so I also figure that there is some simple file trick I have to do for the makefile in order to have it compile
for quick reference, heres the makefile:
CXX=g++
CXXFLAGS= -std=c++0x -Wall -pedantic
LDFLAGS=
SOURCES=main.cpp BigMoneyAI.cpp CardManager.cpp Game.cpp GameState.cpp HumanInputAI.cpp Move.cpp Node.cpp Player.cpp PlayerState.cpp UCTMonteCarlo.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=dominionuct
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) -o $#
.cpp.o:
$(CC) $(CFLAGS) $< -o $#
I'm at a bit of a loss where to go with this, any help or tips to investigate would be much appreciated!
Thanks!

Running Boost library but getting clang error when using gcc on Mac

I am trying to run this example (from: https://theboostcpplibraries.com/boost.serialization-archive#ex.serialization_01):
#include <boost/archive/text_oarchive.hpp>
#include <iostream>
using namespace boost::archive;
int main()
{
text_oarchive oa{std::cout};
int i = 1;
oa << i;
}
With the command:
gcc -L"/usr/local/include/" test.cpp
And I am getting the following back:
Undefined symbols for architecture x86_64:
"boost::locale::base_message_format<char>::id", referenced from:
boost::locale::basic_message<char>::write(std::__1::locale const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in test-e8c2b0.o
"boost::locale::details::format_parser::get_position()", referenced from:
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
"boost::locale::details::format_parser::set_one_flag(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:
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
"boost::locale::details::format_parser::restore()", referenced from:
boost::locale::basic_format<char>::format_guard::restore() in test-e8c2b0.o
"boost::locale::details::format_parser::format_parser(std::__1::ios_base&, void*, void (*)(void*, std::__1::locale const&))", referenced from:
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
"boost::locale::details::format_parser::~format_parser()", referenced from:
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
"boost::locale::ios_info::display_flags(unsigned long long)", referenced from:
boost::locale::as::number(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::currency(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::date(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::time(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::strftime(std::__1::ios_base&) in test-e8c2b0.o
"boost::locale::ios_info::date_time_pattern_set()", referenced from:
void boost::locale::ios_info::date_time_pattern<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test-e8c2b0.o
"boost::locale::ios_info::get(std::__1::ios_base&)", referenced from:
boost::locale::as::number(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::currency(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::date(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::as::time(std::__1::ios_base&) in test-e8c2b0.o
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
void boost::locale::details::format_parser::set_flag_with_str<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test-e8c2b0.o
boost::locale::as::strftime(std::__1::ios_base&) in test-e8c2b0.o
...
"boost::locale::converter<char>::id", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_upper<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_lower<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_title<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::fold_case<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
"boost::locale::generator::generator()", referenced from:
_main in test-e8c2b0.o
"boost::locale::generator::~generator()", referenced from:
_main in test-e8c2b0.o
"boost::locale::ios_info::domain_id() const", referenced from:
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
"boost::locale::generator::generate(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const", referenced from:
boost::locale::generator::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const", referenced from:
void boost::locale::details::format_parser::set_flag_with_str<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test-e8c2b0.o
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
void std::__1::vector<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> > >::__push_back_slow_path<boost::locale::details::formattible<char> const>(boost::locale::details::formattible<char> const&) in test-e8c2b0.o
"std::__1::locale::has_facet(std::__1::locale::id&) const", referenced from:
boost::locale::basic_message<char>::write(std::__1::locale const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in test-e8c2b0.o
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_upper<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_lower<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::to_title<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::locale::fold_case<char>(char const*, std::__1::locale const&) in test-e8c2b0.o
boost::locale::basic_message<char>::write(std::__1::locale const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
...
"std::__1::ios_base::getloc() const", referenced from:
_main in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
boost::locale::basic_format<char>::imbue_locale(void*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::logic_error::logic_error(char const*)", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"std::length_error::~length_error()", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
_main in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(unsigned long, char)", referenced from:
std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > std::__1::__pad_and_output<char, std::__1::char_traits<char> >(std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> >, char const*, char const*, char const*, std::__1::ios_base&, char) in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
boost::locale::basic_message<char>::str(std::__1::locale const&, int) const in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
boost::locale::details::string_cast_traits<char>::cast(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
boost::locale::details::string_cast_traits<char>::cast(char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in test-e8c2b0.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::locale::basic_format<char>::basic_format(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test-e8c2b0.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
_main in test-e8c2b0.o
boost::locale::basic_format<char>::~basic_format() in test-e8c2b0.o
boost::locale::basic_message<char>::~basic_message() in test-e8c2b0.o
boost::locale::basic_format<char>::basic_format(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test-e8c2b0.o
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
boost::locale::basic_message<char>::str(std::__1::locale const&, int) const in test-e8c2b0.o
boost::locale::basic_format<char>::format_output(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) const in test-e8c2b0.o
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::put(char)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(double)", referenced from:
_main in test-e8c2b0.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(long)", referenced from:
_main in test-e8c2b0.o
void boost::locale::details::formattible<char>::write<long>(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, void const*) in test-e8c2b0.o
"std::__1::cout", referenced from:
_main in test-e8c2b0.o
"std::__1::ctype<char>::id", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::locale::global(std::__1::locale const&)", referenced from:
_main in test-e8c2b0.o
"std::__1::locale::locale(std::__1::locale const&)", referenced from:
_main in test-e8c2b0.o
boost::locale::basic_format<char>::imbue_locale(void*, std::__1::locale const&) in test-e8c2b0.o
"std::__1::locale::locale()", referenced from:
_main in test-e8c2b0.o
"std::__1::locale::~locale()", referenced from:
_main in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
boost::locale::basic_format<char>::write(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in test-e8c2b0.o
boost::locale::basic_format<char>::imbue_locale(void*, std::__1::locale const&) in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::locale::operator=(std::__1::locale const&)", referenced from:
_main in test-e8c2b0.o
boost::locale::basic_format<char>::imbue_locale(void*, std::__1::locale const&) in test-e8c2b0.o
"std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::ios_base::clear(unsigned int)", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
"std::__1::ios_base::imbue(std::__1::locale const&)", referenced from:
_main in test-e8c2b0.o
boost::locale::basic_format<char>::imbue_locale(void*, std::__1::locale const&) in test-e8c2b0.o
"std::terminate()", referenced from:
___clang_call_terminate in test-e8c2b0.o
"typeinfo for std::length_error", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"typeinfo for char", referenced from:
void boost::locale::ios_info::string_set::set<char>(char const*) in test-e8c2b0.o
"vtable for std::length_error", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"operator delete[](void*)", referenced from:
void boost::locale::ios_info::string_set::set<char>(char const*) in test-e8c2b0.o
"operator delete(void*)", referenced from:
std::__1::__vector_base<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> > >::~__vector_base() in test-e8c2b0.o
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::~__split_buffer() in test-e8c2b0.o
"operator new[](unsigned long)", referenced from:
void boost::locale::ios_info::string_set::set<char>(char const*) in test-e8c2b0.o
"operator new(unsigned long)", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"___cxa_allocate_exception", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"___cxa_begin_catch", referenced from:
___clang_call_terminate in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
boost::locale::basic_format<char>::format_guard::~format_guard() in test-e8c2b0.o
"___cxa_call_unexpected", referenced from:
boost::locale::basic_message<char>::write(std::__1::locale const&, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in test-e8c2b0.o
void boost::locale::details::format_parser::set_flag_with_str<char>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in test-e8c2b0.o
"___cxa_end_catch", referenced from:
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::__put_character_sequence<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned long) in test-e8c2b0.o
boost::locale::basic_format<char>::format_guard::~format_guard() in test-e8c2b0.o
"___cxa_free_exception", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"___cxa_throw", referenced from:
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
"___gxx_personality_v0", referenced from:
_main in test-e8c2b0.o
std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::endl<char, std::__1::char_traits<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) in test-e8c2b0.o
boost::locale::basic_format<char>::~basic_format() in test-e8c2b0.o
boost::locale::basic_message<char>::~basic_message() in test-e8c2b0.o
boost::locale::basic_format<char>::basic_format(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in test-e8c2b0.o
void std::__1::vector<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> > >::__push_back_slow_path<boost::locale::details::formattible<char> const>(boost::locale::details::formattible<char> const&) in test-e8c2b0.o
std::__1::__split_buffer<boost::locale::details::formattible<char>, std::__1::allocator<boost::locale::details::formattible<char> >&>::__split_buffer(unsigned long, unsigned long, std::__1::allocator<boost::locale::details::formattible<char> >&) in test-e8c2b0.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Not sure why I am getting a clang error when I am using gcc and why there is an error with 86_64.
Edit: with adding the commands recommended by #walnut now I am getting:
Desktop $ gcc -L"/usr/local/include/" test.cpp -lboost_serialization -lboost_locale
ld: library not found for -lboost_serialization
clang: error: linker command failed with exit code 1 (use -v to see invocation)

boost logging fails to compile on OSX

trying to use Boost.Log on OSX (via MacPorts)
/*
* Copyright Andrey Semashev 2007 - 2013.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/log/core.hpp>
#include <boost/log/trivial.hpp>
#include <boost/log/expressions.hpp>
namespace logging = boost::log;
//[ example_tutorial_trivial_with_filtering
void init()
{
logging::core::get()->set_filter
(
logging::trivial::severity >= logging::trivial::info
);
}
int main(int, char*[])
{
init();
BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
BOOST_LOG_TRIVIAL(debug) << "A debug severity message";
BOOST_LOG_TRIVIAL(info) << "An informational severity message";
BOOST_LOG_TRIVIAL(warning) << "A warning severity message";
BOOST_LOG_TRIVIAL(error) << "An error severity message";
BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message";
return 0;
}
//]
(code sample taken from http://www.boost.org/doc/libs/1_54_0_beta1/libs/log/example/doc/tutorial_trivial_flt.cpp)
but when compiling lot of unresolved externals errors are produced:
$ gcc -I/opt/local/include loggertest.cpp -o loggertest -L/opt/local/lib -lboost_log-mt
Undefined symbols for architecture x86_64:
"boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)", referenced from:
boost::log::v2s_mt_posix::record::reset() in loggertest-87632e.o
"boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)", referenced from:
boost::log::v2s_mt_posix::attribute_name::attribute_name(char const*) in loggertest-87632e.o
"boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::auto_release::~auto_release() in loggertest-87632e.o
"boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&) in loggertest-87632e.o
"boost::log::v2s_mt_posix::aux::unhandled_exception_count()", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::~record_pump() in loggertest-87632e.o
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&) in loggertest-87632e.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::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.o
"boost::log::v2s_mt_posix::core::set_filter(boost::log::v2s_mt_posix::filter const&)", referenced from:
init() in loggertest-87632e.o
"boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&)", referenced from:
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-87632e.o
"boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&)", referenced from:
boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::push_record_unlocked(boost::rv<boost::log::v2s_mt_posix::record>&) in loggertest-87632e.o
"boost::log::v2s_mt_posix::core::get()", referenced from:
init() in loggertest-87632e.o
"boost::log::v2s_mt_posix::sources::aux::get_severity_level()", referenced from:
boost::log::v2s_mt_posix::sources::aux::severity_level<boost::log::v2s_mt_posix::trivial::severity_level>::set_value(boost::log::v2s_mt_posix::trivial::severity_level) in loggertest-87632e.o
"boost::log::v2s_mt_posix::trivial::logger::get()", referenced from:
_main in loggertest-87632e.o
"boost::log::v2s_mt_posix::attribute_value_set::end() const", referenced from:
boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.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::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.o
"boost::log::v2s_mt_posix::core::get_logging_enabled() const", referenced from:
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, void, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-87632e.o
"std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::__1::ios_base::getloc() const", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::formatted_write(char const*, long) in loggertest-87632e.o
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(unsigned long, char)", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush()", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::formatted_write(char const*, long) in loggertest-87632e.o
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::flush() in loggertest-87632e.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char> >&)", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::sentry::sentry(boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in loggertest-87632e.o
"std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry()", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::sentry::~sentry() in loggertest-87632e.o
"std::__1::ctype<char>::id", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::__1::locale::~locale()", referenced from:
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
"std::terminate()", referenced from:
___clang_call_terminate in loggertest-87632e.o
"vtable for __cxxabiv1::__class_type_info", referenced from:
typeinfo for boost::exception in loggertest-87632e.o
typeinfo for boost::log::v2s_mt_posix::type_info_wrapper::uninitialized in loggertest-87632e.o
typeinfo for boost::log::v2s_mt_posix::aux::visible_type<boost::log::v2s_mt_posix::trivial::severity_level> in loggertest-87632e.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"operator delete(void*)", referenced from:
boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::light_function<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > >(boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > const&, boost::disable_if_c<is_rv_or_same<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> >, boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)> >::value, int>::type) in loggertest-87632e.o
boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::impl<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > >::clone_impl(void const*) in loggertest-87632e.o
boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::impl<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > >::destroy_impl(void*) in loggertest-87632e.o
"operator new(unsigned long)", referenced from:
boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::light_function<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > >(boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > const&, boost::disable_if_c<is_rv_or_same<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> >, boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)> >::value, int>::type) in loggertest-87632e.o
boost::log::v2s_mt_posix::aux::light_function<bool (boost::log::v2s_mt_posix::attribute_value_set const&)>::impl<boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::greater_equal, boost::proto::argsns_::list2<boost::log::v2s_mt_posix::expressions::attribute_actor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity, boost::phoenix::actor>, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::log::v2s_mt_posix::trivial::severity_level>, 0l> > >, 2l> > >::clone_impl(void const*) in loggertest-87632e.o
"___cxa_begin_catch", referenced from:
___clang_call_terminate in loggertest-87632e.o
boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.o
"___cxa_end_catch", referenced from:
boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.o
"___cxa_rethrow", referenced from:
boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-87632e.o
"___gxx_personality_v0", referenced from:
init() in loggertest-87632e.o
_main in loggertest-87632e.o
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, void, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-87632e.o
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::formatted_write(char const*, long) in loggertest-87632e.o
boost::log::v2s_mt_posix::basic_formatting_ostream<char, std::__1::char_traits<char>, std::__1::allocator<char> >::aligned_write(char const*, long) in loggertest-87632e.o
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::~record_pump() in loggertest-87632e.o
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_severity_logger<boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >, boost::log::v2s_mt_posix::trivial::severity_level>::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-87632e.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
other boost libraries (system, thread, filesystem) work well. is there something wrong with my linker flags? build system? installation?
Edit: I also tried using clang++ as suggested, but I get similar errors:
$ clang++ -I/opt/local/include loggertest.cpp -o loggertest -L/opt/local/lib -lboost_log-mt -lboost_log_setup-mt
Undefined symbols for architecture x86_64:
"boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)", referenced from:
boost::log::v2s_mt_posix::record::reset() in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::attribute_name::get_id_from_string(char const*)", referenced from:
boost::log::v2s_mt_posix::attribute_name::attribute_name(char const*) in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::aux::stream_provider<char>::release_compound(boost::log::v2s_mt_posix::aux::stream_provider<char>::stream_compound*)", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::auto_release::~auto_release() in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::aux::stream_provider<char>::allocate_compound(boost::log::v2s_mt_posix::record&)", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&) in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::aux::unhandled_exception_count()", referenced from:
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::~record_pump() in loggertest-0b0a3b.o
boost::log::v2s_mt_posix::aux::record_pump<boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level> >::record_pump(boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>&, boost::log::v2s_mt_posix::record&) in loggertest-0b0a3b.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::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::core::set_filter(boost::log::v2s_mt_posix::filter const&)", referenced from:
init() in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::core::open_record(boost::log::v2s_mt_posix::attribute_set const&)", referenced from:
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::open_record_unlocked<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::core::push_record_move(boost::log::v2s_mt_posix::record&)", referenced from:
boost::log::v2s_mt_posix::sources::basic_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex> >::push_record_unlocked(boost::rv<boost::log::v2s_mt_posix::record>&) in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::core::get()", referenced from:
init() in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::sources::aux::get_severity_level()", referenced from:
boost::log::v2s_mt_posix::sources::aux::severity_level<boost::log::v2s_mt_posix::trivial::severity_level>::set_value(boost::log::v2s_mt_posix::trivial::severity_level) in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::trivial::logger::get()", referenced from:
_main in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::attribute_value_set::end() const", referenced from:
boost::log::v2s_mt_posix::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-0b0a3b.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::value_extractor<boost::log::v2s_mt_posix::trivial::severity_level, boost::log::v2s_mt_posix::fallback_to_none, boost::log::v2s_mt_posix::trivial::tag::severity>::operator()(boost::log::v2s_mt_posix::attribute_name const&, boost::log::v2s_mt_posix::attribute_value_set const&) const in loggertest-0b0a3b.o
"boost::log::v2s_mt_posix::core::get_logging_enabled() const", referenced from:
boost::log::v2s_mt_posix::record boost::log::v2s_mt_posix::sources::basic_composite_logger<char, boost::log::v2s_mt_posix::sources::severity_logger_mt<boost::log::v2s_mt_posix::trivial::severity_level>, boost::log::v2s_mt_posix::sources::multi_thread_model<boost::log::v2s_mt_posix::aux::light_rw_mutex>, boost::log::v2s_mt_posix::sources::features<boost::log::v2s_mt_posix::sources::severity<boost::log::v2s_mt_posix::trivial::severity_level>, void, void, void, void, void, void, void, void, void> >::open_record<boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> >(boost::parameter::aux::tagged_argument<boost::log::v2s_mt_posix::keywords::tag::severity, boost::log::v2s_mt_posix::trivial::severity_level const> const&) in loggertest-0b0a3b.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Edit: solved by compiling with -DBOOST_LOG_DYN_LINK as suggested by #neverpanic
You are experiencing a standard library mismatch. Boost from MacPorts (and all other libraries from MacPorts and on modern OS X since 10.9, I think) are built against clang's libc++, rather than gcc's libstdc++. If you attempt to mix both standard libraries, you'll run into this problem (which is a good thing, because if you wouldn't see this, you'd likely see hard to debug crashes at runtime).
You need to use clang++ instead of gcc to compile your code. Alternatively, you can use /usr/bin/g++, which is nowadays a symlink to clang.

Lots of: 'Apple Mach-O Linker Errors'

I have made an iPhone app in Xcode that uses the DropBox API. I have got 23 errors all named Apple Mach-O Linker Errors. I have linked my binary with the dropbox library as well as: SystemConfiguration, QuartzCore, Security, CFNetwork, CoreGraphics, UIKit and Foundation. I am not using all of those frameworks but DropBox told me I must import some of them, and I am using the rest.
What should I do?
Here is one of the errors:
Ld /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop normal armv7
cd /Users/Zach/Desktop/SnapDrop
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode5-DP3.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode5-DP3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode5-DP3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos -F/Users/Zach/Desktop/SnapDrop -F/Users/Zach/Desktop/SnapDrop/../../Downloads/dropbox-ios-sync-sdk-1-1.1.0 -filelist /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop.LinkFileList -dead_strip -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework Dropbox -framework QuartzCore -framework SystemConfiguration -framework Security -framework CFNetwork -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Intermediates/SnapDrop.build/Debug-iphoneos/SnapDrop.build/Objects-normal/armv7/SnapDrop_dependency_info.dat -o /Users/Zach/Library/Developer/Xcode/DerivedData/SnapDrop-fwhwffwawcnkfwbxvokogcjaaahb/Build/Products/Debug-iphoneos/SnapDrop.app/SnapDrop
Undefined symbols for architecture armv7:
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"operator new(unsigned long)", referenced from:
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::__clone() const in Dropbox(env.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::reserve(unsigned long)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::chrono::system_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::chrono::steady_clock::now()", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::assign(char const*)", referenced from:
dbx_access_info::is_valid(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) const in Dropbox(sync.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::__throw_system_error(int, char const*)", referenced from:
std::__1::unique_lock<std::__1::mutex>::unlock() in Dropbox(transfer.o)
std::__1::unique_lock<std::__1::mutex>::lock() in Dropbox(transfer.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long)", referenced from:
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&)", referenced from:
LifecycleManager::shutdown() in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::nothrow", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
dbx_env::~dbx_env() in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_request_json(dbx_account*, HttpRequester&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, char const*, int, std::initializer_list<int> const&, std::__1::unique_ptr<json_t, json_deleter>&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
...
"std::__1::condition_variable::notify_all()", referenced from:
LifecycleManager::kick_cvars() in Dropbox(init.o)
LifecycleManager::ThreadRegistration::~ThreadRegistration() in Dropbox(transfer.o)
LifecycleManager::ThreadRegistration::ThreadRegistration(LifecycleManager&) in Dropbox(transfer.o)
dbx_env::dump_log_buffer() const in Dropbox(env.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
"std::__1::condition_variable::~condition_variable()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"std::__1::mutex::unlock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
"operator new(unsigned long, std::nothrow_t const&)", referenced from:
_dropbox_env_init in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
HttpRequester::create(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*)) in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
ThreadLocal<dbx_error_buf>::get() in Dropbox(util.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char)", referenced from:
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_url_encode(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in Dropbox(util.o)
dbx_build_url_with_params(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(util.o)
"std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000000000ll> > >)", referenced from:
std::__1::cv_status std::__1::condition_variable::wait_for<long long, std::__1::ratio<1ll, 1000ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1ll, 1000ll> > const&) in Dropbox(sync.o)
std::__1::cv_status std::__1::condition_variable::wait_for<long, std::__1::ratio<3600ll, 1ll> >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::duration<long, std::__1::ratio<3600ll, 1ll> > const&) in Dropbox(api.o)
"std::__1::mutex::~mutex()", referenced from:
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::~dbx_env() in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(init.o)
__GLOBAL__I_a in Dropbox(env.o)
"operator delete(void*)", referenced from:
_dropbox_env_destroy in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_destroy in Dropbox(init.o)
dbx_env::log_upload_thread() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::~__func() in Dropbox(env.o)
std::__1::__function::__func<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'(), std::__1::allocator<HttpRequester::HttpRequester(dbx_env*, LifecycleManager&, std::__1::mutex*, void*, void (*)(void*), void*)::'lambda'()>, void ()>::destroy_deallocate() in Dropbox(env.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
dbx_env::dbx_env(dbx_http const*, dbx_env_config const*) in Dropbox(init.o)
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
_dropbox_api_unlink in Dropbox(api.o)
dbx_api_account_info(dbx_account*, std::__1::unique_ptr<dbx_account_info, dbx_account_info_deleter>*, std::__1::unique_ptr<dbx_access_info, std::__1::default_delete<dbx_access_info> >*, HttpRequester&, int) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
build_authed_url(dbx_account const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::initializer_list<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > const&) in Dropbox(api.o)
dbx_upload_log_file(dbx_env const*, HttpRequester&, char const*, long long, long long, char const*, long long) in Dropbox(api.o)
"std::__1::mutex::lock()", referenced from:
_dropbox_set_online in Dropbox(init.o)
_dropbox_lib_setup in Dropbox(init.o)
_dropbox_env_shutdown in Dropbox(init.o)
_dropbox_account_init in Dropbox(init.o)
_dropbox_account_shutdown in Dropbox(init.o)
void LifecycleManager::all_lock_helper<void, dropbox_set_online::$_0>(vq_node<std::__1::mutex&>*, dropbox_set_online::$_0) in Dropbox(init.o)
LifecycleManager::shutdown() in Dropbox(init.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You didn't mention adding libc++.dylib. Per https://www.dropbox.com/developers/sync/sdks/ios:
Ensure that you have CFNetwork.framework, Security.framework,
SystemConfiguration.framework, QuartzCore.framework, and libc++.dylib
added to your project. To do this, select your project file in the
file explorer, select your target, and select the Build Phases
sub-tab. Under Link Binary with Libraries, press the + button, select
CFNetwork.framework, and press Add. Repeat for Security.framework,
SystemConfiguration.framework, QuartzCore.framework, and libc++.dylib.
Please let me know if there are setup instructions somewhere that don't mention libc++.dylib.
You could try to add libstdc++.dylib.

Compiling a cpp file that uses Opencv

So I have a .cpp file that uses OpenCV. I've been having some problems with linking the libraries but I think my Makefile is "better" now.
Makefile:
CC=g++
#CC=gcc
# compile flags
CFLAGS=-g -Wall
# OpenCV Related
prefix=/usr/local/opencv
OCVFLAGS=-I${prefix}/include/opencv -I${prefix}/include
OCVLIBS=-L${prefix}/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_ml -lopencv_video -lopencv_features2d -lopencv_flann -lopencv_objdetect -lopencv_calib3d
PROGRAM=extractDescriptorsToFile
OBJECTS=$(PROGRAM).o
program: $(OBJECTS)
$(CC) $(OBJECTS) -o $(PROGRAM) $(OCVLIBS) -arch i386
$(PROGRAM).o: $(PROGRAM).cpp
$(CC) -c $(CFLAGS) $(OCVFLAGS) $(PROGRAM).cpp
clean:
rm -f *o
rm -f $(PROGRAM)
rm -f *~
However, when I "make", the .o file is generated but I get this error:
ld: warning: ignoring file extractDescriptorsToFile.o, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols for architecture i386:
"_main", referenced from:
start in crt1.10.6.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [program] Error 1
This is a similar post " Precompiled headers and compiling universal objects on OSX " but I don't think its quite my problem?
Any help would be appreciated...?
I think this error is sometimes cause by not having a main() but my file does...
Removing "-arch i386" leaves me with:
Undefined symbols for architecture x86_64:
"cv::operator<<(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
cv::operator<<(cv::FileStorage&, char const*)in extractDescriptorsToFile.o
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
_main in extractDescriptorsToFile.o
"cv::Ptr<CvFileStorage>::delete_obj()", referenced from:
cv::Ptr<CvFileStorage>::release() in extractDescriptorsToFile.o
"cv::fastFree(void*)", referenced from:
cv::Ptr<CvFileStorage>::release() in extractDescriptorsToFile.o
cv::Ptr<cv::FeatureDetector>::release() in extractDescriptorsToFile.o
cv::Ptr<cv::DescriptorExtractor>::release() in extractDescriptorsToFile.o
cv::Mat::~Mat() in extractDescriptorsToFile.o
"cv::fastMalloc(unsigned long)", referenced from:
cv::Ptr<cv::FeatureDetector>::Ptr(cv::FeatureDetector*)in extractDescriptorsToFile.o
"cv::Mat::deallocate()", referenced from:
cv::Mat::release() in extractDescriptorsToFile.o
"cv::Mat::copySize(cv::Mat const&)", referenced from:
cv::Mat::operator=(cv::Mat const&)in extractDescriptorsToFile.o
"cv::Exception::Exception(int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)", referenced from:
cv::FileStorage& cv::operator<< <cv::Mat>(cv::FileStorage&, cv::Mat const&)in extractDescriptorsToFile.o
"cv::error(cv::Exception const&)", referenced from:
cv::FileStorage& cv::operator<< <cv::Mat>(cv::FileStorage&, cv::Mat const&)in extractDescriptorsToFile.o
"cv::Exception::~Exception()", referenced from:
cv::FileStorage& cv::operator<< <cv::Mat>(cv::FileStorage&, cv::Mat const&)in extractDescriptorsToFile.o
"cv::write(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&)", referenced from:
cv::FileStorage& cv::operator<< <cv::Mat>(cv::FileStorage&, cv::Mat const&)in extractDescriptorsToFile.o
"cv::_OutputArray::_OutputArray(cv::Mat&)", referenced from:
resizeImage(cv::Mat const&, int)in extractDescriptorsToFile.o
"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:
resizeImage(cv::Mat const&, int)in extractDescriptorsToFile.o
"cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)", referenced from:
resizeImage(cv::Mat const&, int)in extractDescriptorsToFile.o
"cv::OrbFeatureDetector::OrbFeatureDetector(unsigned long, cv::ORB::CommonParams)", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::FeatureDetector::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::DescriptorExtractor::create(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::imread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::FeatureDetector::detect(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::DescriptorExtractor::compute(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat&) const", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::write(cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> > const&)", referenced from:
extract(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, char**, cv::FileStorage&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in extractDescriptorsToFile.o
"cv::FileStorage::FileStorage()", referenced from:
_main in extractDescriptorsToFile.o
"cv::FileStorage::FileStorage(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
_main in extractDescriptorsToFile.o
"cv::FileStorage::~FileStorage()", referenced from:
_main in extractDescriptorsToFile.o
"cv::FileStorage::isOpened() const", referenced from:
_main in extractDescriptorsToFile.o
"cv::FileStorage::release()", referenced from:
_main in extractDescriptorsToFile.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [program] Error 1
This is what I get when I add -arch i386 to both program and $(PROGRAM).o:
Undefined symbols for architecture i386:
"_gzputs", referenced from:
icvPuts(CvFileStorage*, char const*)in libopencv_core.a(persistence.o)
"_gzgets", referenced from:
icvGets(CvFileStorage*, char*, int)in libopencv_core.a(persistence.o)
"_gzeof", referenced from:
icvEof(CvFileStorage*) in libopencv_core.a(persistence.o)
"_gzclose", referenced from:
_cvReleaseFileStorage in libopencv_core.a(persistence.o)
_cvOpenFileStorage in libopencv_core.a(persistence.o)
"_gzopen", referenced from:
_cvOpenFileStorage in libopencv_core.a(persistence.o)
"_gzrewind", referenced from:
_cvOpenFileStorage in libopencv_core.a(persistence.o)
"cv::Mat::convertTo(cv::Mat&, int, double, double) const", referenced from:
cv::imencode(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(loadsave.o)
cv::imwrite_(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<int, std::allocator<int> > const&, bool)in libopencv_highgui.a(loadsave.o)
"cv::flip(cv::Mat const&, cv::Mat&, int)", referenced from:
_cvEncodeImage in libopencv_highgui.a(loadsave.o)
cv::imwrite_(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<int, std::allocator<int> > const&, bool)in libopencv_highgui.a(loadsave.o)
"_jpeg_destroy_decompress", referenced from:
cv::JpegDecoder::close() in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::~JpegDecoder()in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::~JpegDecoder()in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::~JpegDecoder()in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_CreateCompress", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_std_error", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_destroy_compress", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_set_defaults", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_set_quality", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_start_compress", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_write_scanlines", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_finish_compress", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_stdio_dest", referenced from:
cv::JpegEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_start_decompress", referenced from:
cv::JpegDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_read_scanlines", referenced from:
cv::JpegDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_finish_decompress", referenced from:
cv::JpegDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_alloc_huff_table", referenced from:
cv::JpegDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_CreateDecompress", referenced from:
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_read_header", referenced from:
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_stdio_src", referenced from:
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
"_jpeg_resync_to_restart", referenced from:
cv::jpeg_buffer_src(jpeg_decompress_struct*, cv::JpegSource*) in libopencv_highgui.a(grfmt_jpeg.o)
cv::JpegDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg.o)
"_jas_init", referenced from:
__static_initialization_and_destruction_0(int, int)in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_cleanup", referenced from:
___tcf_0 in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_matrix_create", referenced from:
cv::Jpeg2KEncoder::writeComponent16u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KEncoder::writeComponent8u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_writecmpt", referenced from:
cv::Jpeg2KEncoder::writeComponent16u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KEncoder::writeComponent8u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_matrix_destroy", referenced from:
cv::Jpeg2KEncoder::writeComponent16u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KEncoder::writeComponent8u(void*, cv::Mat const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_stream_close", referenced from:
cv::Jpeg2KDecoder::close() in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_destroy", referenced from:
cv::Jpeg2KDecoder::close() in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_create", referenced from:
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_stream_fopen", referenced from:
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
cv::Jpeg2KDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_strtofmt", referenced from:
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_encode", referenced from:
cv::Jpeg2KEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_getcmptbytype", referenced from:
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_cmprof_createfromclrspc", referenced from:
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_chclrspc", referenced from:
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_cmprof_destroy", referenced from:
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_readcmpt", referenced from:
cv::Jpeg2KDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_jpeg2000.o)
"_jas_image_decode", referenced from:
cv::Jpeg2KDecoder::readHeader() in libopencv_highgui.a(grfmt_jpeg2000.o)
"_png_destroy_read_struct", referenced from:
cv::PngDecoder::close() in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::~PngDecoder()in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::~PngDecoder()in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::~PngDecoder()in libopencv_highgui.a(grfmt_png.o)
"_png_create_write_struct", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_create_info_struct", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_destroy_write_struct", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_write_fn", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_filter", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_compression_level", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_compression_strategy", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_IHDR", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_write_info", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_bgr", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_write_image", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_write_end", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_set_compression_mem_level", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
"_png_init_io", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_set_swap", referenced from:
cv::PngEncoder::write(cv::Mat const&, std::vector<int, std::allocator<int> > const&)in libopencv_highgui.a(grfmt_png.o)
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_strip_alpha", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_read_update_info", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_read_image", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_read_end", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_rgb_to_gray", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_gray_to_rgb", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_expand_gray_1_2_4_to_8", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_palette_to_rgb", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_set_strip_16", referenced from:
cv::PngDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_png.o)
"_png_create_read_struct", referenced from:
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_set_read_fn", referenced from:
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_read_info", referenced from:
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_get_IHDR", referenced from:
cv::PngDecoder::readHeader() in libopencv_highgui.a(grfmt_png.o)
"_png_error", referenced from:
cv::PngDecoder::readDataFromBuf(void*, unsigned char*, unsigned long)in libopencv_highgui.a(grfmt_png.o)
"_TIFFClose", referenced from:
cv::TiffDecoder::close() in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::readHeader() in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::~TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::~TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::~TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFIsTiled", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFGetField", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::readHeader() in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFReadEncodedStrip", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFReadRGBAStrip", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFReadEncodedTile", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFReadRGBATile", referenced from:
cv::TiffDecoder::readData(cv::Mat&) in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFOpen", referenced from:
cv::TiffDecoder::readHeader() in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFRGBAImageOK", referenced from:
cv::TiffDecoder::readHeader() in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFSetErrorHandler", referenced from:
cv::TiffDecoder::TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
"_TIFFSetWarningHandler", referenced from:
cv::TiffDecoder::TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
cv::TiffDecoder::TiffDecoder()in libopencv_highgui.a(grfmt_tiff.o)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [program] Error 1
What happens if you remove explicit architecture specification (" -arch i386 ") from line 19? I guess that might help.
EDIT
Well it seems to me that you have a 64-bit OS, and 32-bit OpenCV libraries.