gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 01:31:53 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com