如何安装/应用C++补丁



我正试图在我的计算机上编译一个旧的遗留项目。我被#error "Threading support unavailable: it has been explicitly disabled with BOOST_DISABLE_THREADS卡住了,偶然发现了它的补丁。看看这个问题。我下载了补丁文件。

我该怎么办?如何安装?将它放在指定的文件夹(…\boost_1_48_0\boost\config\stdlib(中没有帮助。

我正在使用boost 1.48;Windows 10上的CodeBlocks IDE和cygwin。

补丁看起来像这样:

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

假设您将补丁放在boost_1_48_0/threads.patch下,您应该能够使用应用它

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

之后可以删除修补程序文件。

最新更新