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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:38:33+00:00 2026-06-09T16:38:33+00:00

I’m writing a small C++ program using Boost’s ‘program_options’ support. The following code: boost::program_options::options_description

  • 0

I’m writing a small C++ program using Boost’s ‘program_options’ support. The following code:

boost::program_options::options_description desc("Allowed options");
desc.add_options()
    (".refreshrate", boost::program_options::value< int >()->default_value(50), "Delay between frames")
    (".location",    boost::program_options::value<std::string>(&__Location), "Camera Location")
    (".address",     boost::program_options::value<std::string>(&__Address), "Address of Camera")
    ;
boost::program_options::variables_map vm;
boost::program_options::store(boost::program_options::parse_config_file(ifile, desc, true), vm);
boost::program_options::notify(vm);

Compiles, but won’t link. I get cryptic linking errors like:

Linking CXX executable main
Undefined symbols for architecture x86_64:
“boost::program_options::validation_error::what() const”, referenced from:
vtable for boost::program_options::invalid_option_value in IEEE1394_Camera.cxx.o
vtable for boost::exception_detail::clone_impl > in IEEE1394_Camera.cxx.o
vtable for boost::exception_detail::error_info_injector in IEEE1394_Camera.cxx.o
vtable for boost::exception_detail::clone_impl > in IEEE1394_Camera.cxx.o
vtable for boost::exception_detail::error_info_injector in IEEE1394_Camera.cxx.o
“boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)”, referenced from:
std::basic_string, std::allocator > const& boost::program_options::validators::get_single_string(std::vector, std::allocator >, std::allocator, std::allocator > > > const&, bool) in IEEE1394_Camera.cxx.o
(maybe you meant: boost::program_options::validation_error::validation_error(boost::program_options::validation_error::kind_t, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&, int))
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

However, simply removing the “.refreshrate” option, or changing it to a std::string instead of an int, fixes it.

I’m compiling with CMake, and I’ve tried Boost 1.49 and Boost 1.5 (compiled myself). I’ve copmiled Boost with both the darwin (default) and gcc toolchain, and using the built-in gcc4.2 and a Macports installed 4.7 . No luck.

Any ideas?

Update: Here’s my full link command (from a ‘make VERBOSE=1’):

“/Applications/CMake 2.8-8.app/Contents/bin/cmake” -E cmake_link_script CMakeFiles/main.dir/link.txt –verbose=1
/opt/local/bin/g++-mp-4.7 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/main.dir/main.cxx.o -o main /Users/rhand/Development/boost-1.50/install/lib/libboost_program_options.a /Users/rhand/Development/boost-1.50/install/lib/libboost_timer.a /Users/rhand/Development/boost-1.50/install/lib/libboost_chrono.a /Users/rhand/Development/boost-1.50/install/lib/libboost_system.a /Users/rhand/Development/boost-1.50/install/lib/libboost_exception.a

  • 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-09T16:38:34+00:00Added an answer on June 9, 2026 at 4:38 pm

    Ok, I figured this out, although I’m still a bit fuzzy as to the details.

    I wiped everything out, went back to the stock gcc4.2 from XCode and rebuilt Boost using this command:

    ./b2 –prefix=/Users/rhand/Development/boost-1.50/install/ –layout=versioned –build-type=complete variant=release link=shared runtime-link=shared threading=single install

    Then, I had to modify some things in my CMake build to get it to link properly:

    set(Boost_COMPILER "-xgcc42")
    

    and Set some environment variables:

    BOOSTROOT=/Users/rhand/Development/boost-1.50/install/
    BOOST_INCLUDEDIR=/Users/rhand/Development/boost-1.50/install/include/boost-1_50/
    BOOST_LIBRARYDIR=/Users/rhand/Development/boost-1.50/install/lib
    

    And then, everything works. I’m not exactly sure what the problem was, unless it’s something special in specifying a Release build or going with all shared libraries…

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am writing an app with both english and french support. The app requests
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.