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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:32:23+00:00 2026-05-12T08:32:23+00:00

I just discovered that when Language Extensions are disabled in MSVC, you get this

  • 0

I just discovered that when Language Extensions are disabled in MSVC, you get this error if you try to include boost/thread/thread.hpp:

fatal error C1189: #error : “Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS“

It seems that when Boost detects that language extensions are disabled (_MSC_EXTENSIONS isn’t defined), they define BOOST_DISABLE_WIN32, to indicate that it is not safe to include windows.h (which won’t compile without extensions enabled).

And as a consequence of that #define, BOOST_DISABLE_THREADS is defined, even though Boost.Thread isn’t a header-only library, and windows.h is only included in the .cpp files. The headers should in principle be safe to use without language extensions. All the actual win32 calls are isolated in the compiled library (the .dll or .lib)

I can see here that they’re aware of the problem, but as it’s remained untouched for the last two years, it’s probably naive to hope for a quick fix.

It seems like it should be a fairly simple case of modifying some of the #ifdef‘s and #defines in the various Boost configuration files, but there are a lot of them, and they define and use a lot of macros whose purpose isn’t clear to me.

Do anyone know of a simple hack or workaround to allow inclusion of the Boost.Thread headers when language extensions are disabled?

  • 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-12T08:32:23+00:00Added an answer on May 12, 2026 at 8:32 am

    I don’t see any simple way to turn off the behavior.

    You could wrap the block with your own #ifdef starting at boost\config\suffix.hpp(214):

    #ifndef TEMP_HACK_DONT_DISABLE_WIN32_THREADS // XXX TODO FIXME
    
    #if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
       && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
    #  define BOOST_DISABLE_THREADS
    #endif
    
    #endif // ndef TEMP_HACK_DONT_DISABLE_WIN32_THREADS
    

    Not a perfect fix, but it should be temporary until you can get them to fix it upstream. The boost stuff is good, but it’s not immutable in its perfection.

    Of course, make some kind of tracking item so you don’t lose track of your divergence from upstream.

    • 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.