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 7854061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:55:11+00:00 2026-06-02T19:55:11+00:00

I am still struggling with libc++ and boost. i compiled the boost with libc++

  • 0

I am still struggling with libc++ and boost.

i compiled the boost with libc++ like here:
How to compile/link Boost with clang++/libc++?

now i am seeing this compile error on one of my machine while the other one compiles perfectly fine with the exact code. Both of them has the same compiler version and environment variables are the same too.

Here is the error:

Linking CXX executable main
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/main.dir/link.txt --verbose=1
/usr/bin/clang++    -arch x86_64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++ CMakeFiles/main.dir/main.cpp.o  -o main  /usr/lib/libpython2.7.dylib /opt/local/lib/libboost_program_options-mt-d.a /opt/local/lib/libboost_filesystem-mt-d.a /opt/local/lib/libboost_system-mt.a /opt/local/lib/libboost_date_time-mt.a /opt/local/lib/libboost_python-mt.a /opt/local/lib/libboost_log-mt.a /opt/local/lib/libboost_thread-mt.a 
Undefined symbols for architecture x86_64:
  "__ZNSt3__112basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6appendIPwEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueERS5_E4typeES9_S9_", referenced from:
      std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > boost::detail::convert<wchar_t, char, boost::_bi::bind_t<std::__1::codecvt_base::result, boost::_mfi::cmf7<std::__1::codecvt_base::result, std::__1::codecvt<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::__1::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, boost::_bi::bind_t<std::__1::codecvt_base::result, boost::_mfi::cmf7<std::__1::codecvt_base::result, std::__1::codecvt<wchar_t, char, __mbstate_t>, __mbstate_t&, char const*, char const*, char const*&, wchar_t*, wchar_t*, wchar_t*&>, boost::_bi::list8<boost::_bi::value<std::__1::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >) in libboost_program_options-mt-d.a(convert.o)
  "__ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendIPcEENS_9enable_ifIXsr21__is_forward_iteratorIT_EE5valueERS5_E4typeES9_S9_", referenced from:
      std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > boost::detail::convert<char, wchar_t, boost::_bi::bind_t<std::__1::codecvt_base::result, boost::_mfi::cmf7<std::__1::codecvt_base::result, std::__1::codecvt<wchar_t, char, __mbstate_t>, __mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&>, boost::_bi::list8<boost::_bi::value<std::__1::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > > >(std::__1::basic_string<wchar_t, std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, boost::_bi::bind_t<std::__1::codecvt_base::result, boost::_mfi::cmf7<std::__1::codecvt_base::result, std::__1::codecvt<wchar_t, char, __mbstate_t>, __mbstate_t&, wchar_t const*, wchar_t const*, wchar_t const*&, char*, char*, char*&>, boost::_bi::list8<boost::_bi::value<std::__1::codecvt<wchar_t, char, __mbstate_t> const*>, boost::arg<1>, boost::arg<2>, boost::arg<3>, boost::arg<4>, boost::arg<5>, boost::arg<6>, boost::arg<7> > >) in libboost_program_options-mt-d.a(convert.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[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2

I am still stuck with ABI incompatibility issue?

Here is the code:

#include <iostream>
#include <string>
#include <tuple>
#include <mutex>
#include <boost/filesystem.hpp>
#include <boost/system/system_error.hpp>
#include <boost/system/error_code.hpp>
#include <boost/program_options.hpp>
#include <CoreFoundation/CoreFoundation.h>
namespace po = boost::program_options;
int main(int ac, char* av[])
{
    using namespace std;
    std::mutex mymutex;
    std::tuple<int, int ,char> mytuple;

    boost::filesystem::path mypath("/usr/local/bin");
    boost::filesystem::path agaain("/usr");

    try {

        po::options_description desc("Allowed options");
        desc.add_options()
            ("help", "produce help message")
            ("compression", po::value<double>(), "set compression level")
        ;

        po::variables_map vm;        
        po::store(po::parse_command_line(ac, av, desc), vm);
        po::notify(vm);    

        if (vm.count("help")) {
            cout << desc << "\n";
            return 0;
        }

        if (vm.count("compression")) {
            cout << "Compression level was set to " 
                 << vm["compression"].as<double>() << ".\n";
        } else {
            cout << "Compression level was not set.\n";
        }
    }
    catch(exception& e) {
        cerr << "error: " << e.what() << "\n";
        return 1;
    }
    catch(...) {
        cerr << "Exception of unknown type!\n";
    }

    return 0;
}

the code compiles fine, but only errors out when linking. Here is the extra info from compile:

chen@work:build$ make VERBOSE=1
/opt/local/bin/cmake -H/Users/chen/Code/clang -B/Users/chen/Code/clang/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /Users/chen/Code/clang/build/CMakeFiles /Users/chen/Code/clang/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/depend
cd /Users/chen/Code/clang/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/chen/Code/clang /Users/chen/Code/clang /Users/chen/Code/clang/build /Users/chen/Code/clang/build /Users/chen/Code/clang/build/CMakeFiles/main.dir/DependInfo.cmake --color=
Dependee "/Users/chen/Code/clang/build/CMakeFiles/main.dir/DependInfo.cmake" is newer than depender "/Users/chen/Code/clang/build/CMakeFiles/main.dir/depend.internal".
Dependee "/Users/chen/Code/clang/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/Users/chen/Code/clang/build/CMakeFiles/main.dir/depend.internal".
Scanning dependencies of target main
make -f CMakeFiles/main.dir/build.make CMakeFiles/main.dir/build
/opt/local/bin/cmake -E cmake_progress_report /Users/chen/Code/clang/build/CMakeFiles 1
[100%] Building CXX object CMakeFiles/main.dir/main.cpp.o
/usr/bin/clang++    -arch x86_64 -I/Users/chen/Code/clang -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Headers -I/Users/chen/Code/clang/Utilities/includes    -std=c++11 -stdlib=libc++ -o CMakeFiles/main.dir/main.cpp.o -c /Users/chen/Code/clang/main.cpp

On the other hand, on the machine that compiles fine, i can literally “SEE” the speed of libc++. When used in Xcode, it’s very very fast and code completion with libc++ is amazing.

But before i enjoy further, I really want to get to the bottom of this…

  • 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-02T19:55:14+00:00Added an answer on June 2, 2026 at 7:55 pm

    I just figured out my problem. it was due to Boost not compiled properly because libiconv is not recognized by bjam in my other machine. I guess the reason that it was not recognized is probably because i installed macport. Immediately after i uninstall all the macport stuff, bjam can recognize libiconv and build boost properly under libc++ except signals, but that’s alright.

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

Sidebar

Related Questions

still struggling with regex :) i have this code: $link = '/\bhttp:\/\/.+\..+[\/\w]?\b/i'; $match =
Apologies about this simple question. Still struggling with some of the memory concepts here.
I have been struggling with this yesterday whole day, and still couldnt figure it
Edit: Because I'm still struggleing with this, here's additional information: The matrix has the
Still struggling with R, especially with error handling: If I use: result <- try(sqlSave(ch,df,tablename=tblTest))
I'm still struggling with this concept. I have two different Person objects, very simply:
I've looked through some posts around here, but am still struggling to get my
Really like objectify, although still struggling with what is the best way to structure
Following on from this question , I am still struggling with the Twitter Bootstrap.
I fear this has been beaten to death, but I'm still struggling with the

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.