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

  • Home
  • SEARCH
  • 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 8424489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:00:25+00:00 2026-06-10T04:00:25+00:00

I’m writing a C++ program for which I would like to use some functionality

  • 0

I’m writing a C++ program for which I would like to use some functionality from Boost (not just the header-only modules), and which I’m distributing in source form. I’d like it to work on as many operating systems as possible, but take Linux for the sake of being concrete. (I’m more used to Windows, but there I can fall back on shipping a binary, as long as Boost is amenable to static linking.)

Right now, I’m shipping a simple handwritten makefile, so the procedure for compiling the program is just make. However, I’m given to understand this no longer works when you bring Boost into the equation, because you can’t know what version (if any) will be available on the user’s machine, or where the header and library files will be located, and that one should instead use a build system such as autotools or CMake.

Is this correct? If so, which build system should be used if the highest priority is reliability (i.e. maximizing the probability that it will work when a user tries to compile and install the program)?

(I’m also planning to use GMP, if that makes a difference.)

  • 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-10T04:00:26+00:00Added an answer on June 10, 2026 at 4:00 am

    Compiling a program that uses Boost statically is quite simple in CMake. Using the FindBoost module handles it for you.

    An example CMakeLists.txt file for a program that uses program_options statically:

    cmake_minimum_required(VERSION 2.8)
    project(myproj)
    
    set(Boost_USE_STATIC_LIBS ON)
    find_package(Boost 1.40 REQUIRED COMPONENTS program_options)
    include_directories(${Boost_INCLUDE_DIRS})
    
    add_executable(myexe source_file.cpp)
    target_link_libraries(myexe ${Boost_LIBRARIES})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a text area in my form which accepts all possible characters from
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.