Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to compile a simple C++ test file using libc++ (instead of libstdc++) and the Boost Program Options library from the Ubuntu main repo. The program is as follows:

#include <boost/program_options.hpp>

namespace po = boost::program_options;

int main()
  po::options_description test("Test");
  return 0;

I am compiling this using:

clang++ -stdlib=libc++ test.cpp -lboost_program_options

I am using Ubuntu 13.10 with the pre-build binaries from the main repo for:

libc++: 1.0~svn181765-1  
clang-3.4_1: 3.4~svn183914-1ubuntu1  
boost-program-options1.53: 1.53.0-6+exp3ubuntu8

At the moment this program fails to link, giving me:

test.cpp:(.text+0xa6): undefined reference to `boost::program_options::options_description::options_description(std::__1::basic_string, std::__1::allocator > const&, unsigned int, unsigned int)'

A few searches seem to imply that the solution is to rebuild the Boost library from source against libc++. My question: is there any way to do this by using the system-installed Boost from the main repo?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.