Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何解决C++;错误与<;随机>;Eclipse中的库?_C++_Eclipse_C++11 - Fatal编程技术网

C++ 如何解决C++;错误与<;随机>;Eclipse中的库?

C++ 如何解决C++;错误与<;随机>;Eclipse中的库?,c++,eclipse,c++11,C++,Eclipse,C++11,我在Eclipse中使用GCC4.8.0库;但是,测试以下代码 #include <iostream> #include <random> int main() { int randomSeed = 1234; std::mt19937 gen(randomSeed); return 0; } #包括 #包括 int main() { int-randomSeed=1234; 标准:mt19937 gen(随机

我在Eclipse中使用GCC4.8.0库;但是,测试以下代码

#include <iostream>  
#include <random>  
int main()  
{  
    int randomSeed = 1234;  
    std::mt19937 gen(randomSeed);  
    return 0;  
}  
#包括
#包括
int main()
{  
int-randomSeed=1234;
标准:mt19937 gen(随机种子);
返回0;
}  
错误“无法解析类型'std::mt19937'中的结果”

我使用了-std=c++11和-std=c++0x标志,但没有成功,正如前一篇文章中所建议的:


-reptar

代码是否未编译,或者它只是在
std::mt19937
下显示红线的编辑器?它是编辑器。我找到了一个修复方法,需要转到属性->C/C++常规->路径和符号->符号->添加,然后添加没有定义值的\uuuu GXX\u实验性\uu CXX0X\uuuuuuuuuuuuuuuuuuucLusplus,值为201103L。