c++ - 随机 : no such file or directory

标签 c++ compiler-errors dev-c++

我正在尝试运行一些模拟,但是当我尝试编译我的代码时出现错误

random: No such file or directory

我的代码开头是这样的

#include<iostream>
#include<iomanip>
#include<cmath>
#include<stdlib.h>
#include<random>
#include<set>
#include<algorithm>
#include<fstream>
#include<vector>

using namespace std;

我正在使用 Dev-C++ 5.0 beta 9.2。我应该注意到这段代码在我的家用电脑上编译得很好。

编辑:

在我的编译器选项下没有更改“语言标准”的选项: enter image description here enter image description here

最佳答案

您必须设置 -std=c++11 标志才能使用此 C++11 功能! Random 需要 C++11 才能使用。

关于c++ - 随机 : no such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40025516/

相关文章:

C++ - isdigit 无法正常工作并导致永无止境的循环

C++ std::map 或 std::set - 有效地插入重复项

c++ - 复制构造函数中的指针赋值

c++ - 当我运行C++程序时,它返回某种数字

c++ - 如何指向实际元素而不仅仅是数组地址?

c++ - 如何修复 "Overloaded member function not found"错误?

java - 找不到符号,符号: Method setDate(Date) in Netbeans

Java 编译错误 : cannot find symbol

C++ 字符串 != 字符串

c - 为什么这个 for 循环在第二个索引处结束?