【问题标题】:Boost Process errors on vs2010vs2010上的Boost Process错误
【发布时间】:2026-01-04 05:50:02
【问题描述】:

我正在尝试将 Boost 1.66 与 VS2010 一起使用,但在包含标头后我在编译时遇到了一些问题。任何人都有类似的问题,可以帮助我解决这个问题吗?

我需要调用一个 ffmpeg 进程,并且使用 windows CreateProcess 来构建它是一个痛苦的 a** 并且没有工作。

Error   1   error C3646: 'noexcept' : unknown override specifier    C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   65
Error   2   error C2660: 'boost::process::process_error::process_error' : function does not take 2 arguments    C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   72
Error   3   error C2660: 'boost::process::process_error::process_error' : function does not take 2 arguments    C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   77
Error   4   error C2440: '<function-style-cast>' : cannot convert from 'std::error_code' to 'boost::process::process_error' C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   82
Error   5   error C2146: syntax error : missing ';' before identifier 'Char'    C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   86
Error   6   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   86
Error   7   error C2146: syntax error : missing ';' before identifier 'null_char'   C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   86
Error   8   error C2144: syntax error : 'char' should be preceded by ';'    C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   87
Error   9   error C4430: missing type specifier - int assumed. Note: C++ does not support default-int   C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   87
Error   10  error C2086: 'int boost::process::detail::constexpr' : redefinition C:\_libs\boost_1_66_0\boost\process\detail\config.hpp   87

【问题讨论】:

  • 您是否按照此处的说明进行操作? *.com/questions/2629421/…
  • 我正在使用预构建的二进制文件。所以这一步不是必需的。
  • 据我所知,这些错误与您安装的 boost 版本中使用的 C++11 及更高版本的功能有关。显然 MSVC 2010 没有完全支持 C++11,也不支持 C++14 和现在的 C++17。它不会说你试图喂它的语言。
  • 你可以试试旧版本的 Boost 吗?
  • 旧版本

标签: c++ visual-studio visual-studio-2010 boost


【解决方案1】:

Visual Studio 2010、2012、2013 不支持 noxcept、constexpr。

尝试旧的提升或在包含提升之前添加

#define noexcept
#define constexpr

【讨论】: