Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8617005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:45:15+00:00 2026-06-12T05:45:15+00:00

So I’ve spent the last 20 hours trying to get boost working under OS

  • 0

So I’ve spent the last 20 hours trying to get boost working under OS X 10.8, and I have finally gotten it to compile without errors, but when I try to compile a test case that uses Boost.test, I’m back again in a world of hurt.
I should mention, the reason I compile boost myself instead of using the binary available, is because I want to use c++11 and libc++.

When I compiled boost, I called b2 like this:

./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-std=c++11 -stdlib=libc++" link=static

and it compiles all file. Then I have this piece of code

#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE Addition
#include <boost/test/unit_test.hpp>

int addition(int i, int j)
{
    return i + j;
}

BOOST_AUTO_TEST_CASE(universeInOrder)
{
    BOOST_CHECK(addition(2, 2) == 4);
}

which I
try to compile with

clang++ -std=c++11 -stdlib=libc++ -g -Wall -v -I/Users/cb/Downloads/boost_1_51_0 tests/arithmetic.cpp -o tests/arithmetic /Users/cb/Downloads/boost_1_51_0/stage/lib/libboost_unit_test_framework.a`

And it fails miserably, giving me this error:

"/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o tests/arithmetic /var/folders/pg/4wcxn1j12c3188vqrv0x4w9r0000gn/T/arithmetic-UFmO1B.o     /Users/cb/Downloads/boost_1_51_0/stage/lib/libboost_unit_test_framework.a -lc++ -lSystem     /usr/bin/../lib/clang/4.0/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
  "boost::unit_test::unit_test_main(bool (*)(), int, char**)", referenced from:
      _main in arithmetic-UFmO1B.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

At first, I figured it was because boost was not compiled for 64bit so I tried telling b2 to do that specifically, but it made no difference, and I also think that it compiles for 64bit by default on OS X.

Any ideas as to why it is failing and how I get it working?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:45:16+00:00Added an answer on June 12, 2026 at 5:45 am

    It looks like bad compilation of the test. You requested

    #define BOOST_TEST_DYN_LINK
    

    but than you are linking the static version of boost.test

    /Users/cb/Downloads/boost_1_51_0/stage/lib/libboost_unit_test_framework.a
    

    and IIRC there is a difference between the static and dynamic versions of this library. So either link the dynamic version of the library (the one with .so extension), or remove that define.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.