Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编译我从别人那里得到的 c++ 程序。它是在 windows 上开发的,g++ 给出了一些编译错误。其中之一是与
#include <random>
这给出了以下错误:CandidateSolution.cpp:2:18: error: random: No such file or directory。我试图找到可以从中获取 error.h 文件的位置,但我找不到它。我怎样才能让它工作?
CandidateSolution.cpp:2:18: error: random: No such file or directory
该标头对 C++11 来说是新的。尝试使用-std=c++11或-std=c++0x。此外,请确保您的编译器是最新的。
-std=c++11
-std=c++0x