c++ - 使用 boost 1.4.2 时命名空间前缺少 ';'

标签 c++ visual-studio-2008 boost

致力于将一些 C++ 代码从 Linux 转移到 Windows。该代码使用 boost 1.4.2,但是它在构建 boost 模块时总是失败。基本上,每个恰好包含“命名空间 boost ”错误的 boost hpp 文件:

error C2143: syntax error : missing ';' before 'namespace' 

知道是什么原因造成的吗?

最佳答案

; 在包含 Boost header 之前丢失可能是造成这种情况的原因。以下代码会产生此类错误:

struct X {}  // << ; lost here

#include <boost/shared_ptr.hpp>

这个小代码给我以下错误:

boost/config/suffix.hpp(460) : error C2143: syntax error : missing ';' before 'namespace'

关于c++ - 使用 boost 1.4.2 时命名空间前缺少 ';',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2500261/

相关文章:

c++ - 与第三方公共(public)图书馆/代码接口(interface)

c# - 没有 VS 2008 的 system.dllnotfoundexception

c++ - 重构我的代码。我的标题(Header Guard Issues)

c# - 阻止 Visual Studio 2008 重写内联代码?

c++ - 命名空间的 Boost.Log 错误

c++ - 如何在 Xcode 中使用 boost::multiprecision::float128

宏中的 C++ 编译时间计数器

c# - 嵌入式单声道 : Creating/marshaling a C# struct in C++

php - 如何使用 post 请求将 C++ 数据发送到 PHP 以及允许发送的内容?

c++ - boost::process 异步 IO 示例不起作用?