0

I'm trying to make an old, legacy project compile on my computer. I'm stuck on #error "Threading support unavailable: it has been explicitly disabled with BOOST_DISABLE_THREADS and stumbled on a patch for it. See this question. I downloaded the patch file.

What am I supposed to do with it? How can I install it? Putting it inside the specified folder (...\boost_1_48_0\boost\config\stdlib) didn't help.

I'm using boost 1.48; CodeBlocks IDE and cygwin on Windows 10.

The patch looks like this:

Index: boost/config/stdlib/libstdcpp3.hpp
===================================================================
--- boost/config/stdlib/libstdcpp3.hpp  (revision 75635)
+++ boost/config/stdlib/libstdcpp3.hpp  (working copy)
@@ -33,7 +33,8 @@
 
 #ifdef __GLIBCXX__ // gcc 3.4 and greater:
 #  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
-        || defined(_GLIBCXX__PTHREADS)
+        || defined(_GLIBCXX__PTHREADS) \
+        || defined(_GLIBCXX_HAS_GTHREADS)
       //
       // If the std lib has thread support turned on, then turn it on in Boost
       // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT
Kinaeh
  • 277
  • 6
  • 16
  • Maybe don't disable it? Also, upgrade Boost perhaps? Or, are you really only asking how to apply a patch? Your question is kind-of open ended, what you need to do is to change the software so it compiles. How to do that is impossible to tell from the little info you give. – Ulrich Eckhardt Nov 04 '20 at 08:02
  • @john ah okay, I have to edit the original file. – Kinaeh Nov 04 '20 at 08:07
  • @UlrichEckhardt yes I was asking how to apply the patch. I'm not familiar with c++ programming. I first tried to use updated software but it didn't go well, so I'm trying now to give the project the same setup it had when my predecessor build it back in 2012... – Kinaeh Nov 04 '20 at 08:09

1 Answers1

1

Assuming you put the patch under boost_1_48_0/threads.patch, you should be able to apply it with

cd ...\boost_1_48_0
patch -p0 < threads.patch

You can remove the patch file afterwards.

Botje
  • 26,269
  • 3
  • 31
  • 41