开发者

missing ';' before namespace when using boost 1.4.2

开发者 https://www.devze.com 2022-12-23 16:55 出处:网络
Working on moving some C++ code from Linux over to Windows开发者_运维问答.The code uses boost 1.4.2, however it keeps failing out on building the boost modules. Basically, every boost hpp file that ha

Working on moving some C++ code from Linux over to Windows开发者_运维问答. The code uses boost 1.4.2, however it keeps failing out on building the boost modules. Basically, every boost hpp file that happens to contain "namespace boost" errors with:

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

Any idea what could be causing this?


Loss of ; before including Boost header could be cause of that. The following code produce such error:

struct X {}  // << ; lost here

#include <boost/shared_ptr.hpp>

This small code gives me the following error:

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


Have you tried including these boost headers on the first line? If they compile fine that way, it's likely a missing ; in one of the headers included before them.

0

精彩评论

暂无评论...
验证码 换一张
取 消