简体   繁体   English

错误 C2059:语法错误:“通用”

[英]error C2059: syntax error : 'generic'

When I want to use boost library in my code, and I found an error:当我想在我的代码中使用 boost 库时,我发现了一个错误:

error C2059: syntax error : 'generic'

And this error is coming from the boost/filesystem/path.hpp,这个错误来自boost/filesystem/path.hpp,

path generic() const
{
...
}

And I don't know how to solve it, I google it and it looks like I need to redefine it.而且不知道怎么解决,google了一下,好像需要重新定义一下。 But I really don't know how to do it.但我真的不知道该怎么做。

Try setting: BOOST_FILESYSTEM_NO_DEPRECATED in Visual Studio Preprocessor Definitions as you can see in the following image:尝试在 Visual Studio 预处理器定义中设置: BOOST_FILESYSTEM_NO_DEPRECATED ,如下图所示:

Visual Studio 中的预处理器定义配置页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM