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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:33:03+00:00 2026-05-16T05:33:03+00:00

TLDR Linking my fresh boost build with Visual Studio (/Mtd) causes boost to throw

  • 0

TLDR

Linking my fresh boost build with Visual Studio (/Mtd) causes boost to throw a ‘bad_alloc’ exception before entering the main function.

Details

I built the boost library using the instructions from the Getting Started instructions. After setting up the prerequisites I used the following build command:

bjam -j8 --build-dir="C:\Development\Boost\boost-build" --build-type=complete msvc stage

Above command seems to build all combinations of debug/release and shared/static builds.

Then I created a empty Visual Studio project and added the following code in the main file:

#include <boost/thread.hpp>

int main()
{
    return 0;
}

I also changed the Code Generation settings to Multi-threaded Debug (/MTd).

At this point I did not yet configure any library paths in my project. So the build ended with the following linker error:

LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-sgd-1_43.lib'

Ok, I find this file in my boost build and copy it to ‘$(SolutionDir)3rdParty\Boost_1_43_0\libs’ which I added to the Additional Library Directories. Next error follows:

LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc90-mt-sgd-1_43.lib'

Ok, I also find this file in my boost build directory and copy it to my library path.

After this the project builds succesfully, but a ‘bad_alloc” exception is thrown in boost code, before entering the main function.

It seems that there is a library incompatibility here. Does anyone know what exactly is going wrong, and how to fix it?

Update

Since James McNellis mentioned that this may be something specific to the thread library I tried out ‘program_options’ and this one doesn’t cause any problems (main body is still empty though).

A simple sample application using the boost ‘signal’ library works fine also. So it’s really the thread library that’s causing some problem.

Version

I’m currently using Boost v1.43.0, I’ll see if I can reproduce the problem with v1.42.

BCP

One detail I’d like to mention is that I am using a stripped down version of Boost. I created a subset using the following bcp utility:

mkdir ./output
bcp bind function lexical_cast noncopyable optional program_options smart_ptr signals signals2 thread ./output

This probably isn’t causing the ‘bad_alloc’ though…

Boost 1.42

I just installed Boost 1.42 using the BoostPro Installer. A quick test revealed that it works fine like this. Strange…

  • 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-05-16T05:33:04+00:00Added an answer on May 16, 2026 at 5:33 am

    My solution workaround goes as follows:

    • Install boost using the BoostPro Installer. It installs Boost in the ‘C:\Program Files’ directory.
    • Use the (included) bcp utility to create a slimmed down copy of the boost repository. See my original post for an example.
    • Add the generated headers to my project folder
    • Also copy any needed libs to the project folder.
    • Update the Visual Studio projects include and linker paths where needed.
    • Test it.
    • Commit it all to SVN.
    • Voila, I know have my batteries-included code repository 🙂

    Actually, my original question remains unanswered, I still don’t know why my attempts for Boost 1.43 failed. It’s probably some configuration issue. However, this is a satisfying workaround.

    By the way, the reason why I reverted to Boost 1.42 is simply because the BoostPro Installer does not yet support 1.43.

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

Sidebar

Related Questions

No related questions found

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.