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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:15:04+00:00 2026-06-16T02:15:04+00:00

I use boost.build for my project. Of course, I use boost itself. Also, for

  • 0

I use boost.build for my project. Of course, I use boost itself. Also, for test purposes I use google-test library with my project. I have to link my project with google-test’s static library. I’ve found the workaround to do that for MinGW (for linux’s gcc works too)

exe foo : $(IMPORTANT_PART) $(TEST_UTILITY_PART) : <toolset>gcc <linkflags>"../../libs/gtest-1.6.0/libs/gtest_main.a" <linkflags>-static <linkflags>-lpthread ;

It looks kind of ugly but it works. The rule for msvc looks much much more ugly

exe foo : $(IMPORTANT_PART) $(TEST_UTILITY_PART) : <toolset>msvc <linkflags>/LIBPATH:../../libs/gtest-1.6.0/libs <linkflags>/DEFAULTLIB:gtest_main-mdd.lib
<linkflags>/DEFAULTLIB:gtestd-md.lib
;

Is there more natural way to link target with external static library in boost.build project file.


P.S. Of cource using google-test and boost mix smells not good, but anyway there are a lot of external libraries that cover areas boost doesn’t cover.

TIA

  • 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-16T02:15:06+00:00Added an answer on June 16, 2026 at 2:15 am

    Great! Thank the persond who pointed me http://www.boost.org/boost-build2/doc/html/bbv2/tutorial/prebuilt.html page. (the comment disappeared) It seems to be, I did read this page not carefully. And target lib with file property does the thing I searched for. Thanks!


    As for using google test and boost build I did this way: I made Jamfile for google-test. It is very simple:

    gtest.lib/Jamfile
        project gtest_main 
             : requirements <include>../../../libs/gtest-1.6.0/include
                            <include>../../../libs/gtest-1.6.0/
             : source-location ../../../libs/gtest-1.6.0 
             : build-dir ../../../libs/gtest-1.6.0/bin.b2 ; 
        
        lib gtest_main : src/gtest_main.cc src/gtest-all.cc : <link>static ;
    

    Then, somewhere in my project file:

    use-project /gtest : ./gtest.lib ;

    and mentioning //gtest in project’s requirements section.

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

Sidebar

Related Questions

I am using boost build in my project and now i want to use
I have a rather simple C++ project, which uses boost::regex library. The output I'm
I have gcc 4.4.5 and the latest boost library. I want to use boost
Using boost build, if I can link to a boost python library with this
I want to use Boost library in my iPhone project, specifically only boost::numeric::ublas. I
I am starting a new c++ project and I want to use Boost.Build /
I am trying to use Boost::Fusion (Boost v1.42.0) in a personal project. I get
I have a C++ project which is using boost. The whole project is built
I'm trying to build x64 version of http://code.google.com/p/quickfast/ That's how build scripts use %BOOST_ROOT%:
I want to use the ASSIMP library http://assimp.sourceforge.net in an iOS project. Unfortunately, I'm

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.