Boost logo

Boost Users :

Subject: [Boost-users] Compiling boost asio 1.50.0 under Xcode 4.3.3 with Clang or GCC and c++11 support
From: Graham Reitz (grahamreitz_at_[hidden])
Date: 2012-07-03 11:42:21


(Below) Is this is known issue, am I missing something, or does the libboost_system.a library need to be compiled differently than the default directions to work with c++11 support?

The following code produces linker errors when the compiler options -std=c++11and libc++ are used:

#include <iostream>
#include <boost/asio.hpp>

int main( int argc, char* argv[] )
{
    return 0;
}

Undefined symbols for architecture x86_64:
  "std::allocator<char>::allocator()", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::allocator<char>::~allocator()", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::string::operator=(char const*)", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&)", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
  "std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()", referenced from:
      (anonymous namespace)::generic_error_category::message(int) const in libboost_system.a(error_code.o)
      ___tcf_0 in libboost_system.a(error_code.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net