致力于将一些 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/