为什么随机标头不能导入 [英] Why random header not importing

查看:90
本文介绍了为什么随机标头不能导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C ++编写代码并通过输入 make 进行编译。发生错误:

I have written code in C++ and compiled it by typing make. An error occurs:


/ usr / include / c ++ / 4.8 / bits / c ++ 0x_warning.h:32:2:错误: #error这个
文件需要ISO C ++ 2011
标准的编译器和库支持。此支持目前是实验性的,必须使用-std = c ++ 11或-std = gnu ++ 11编译器选项启用

/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.


推荐答案

随机库使用的是较新版本的C ++标准(C ++ 11)。您需要修改makefile以使用-std = c ++ 11标志。如果你发布你的makefile内容我可以进一步建议你,否则看看这个问题: Makefile修改支持c ++ 11

The random library is using a newer version of the C++ standard (C++11). You need to modify your makefile to use the -std=c++11 flag. If you post your makefile contents I could advise you further, otherwise look at this question: Makefile modification to support c++11

根据发布的cmakefile,将这些行添加到cmakefile中:

Based on the cmakefile posted, add these lines to your cmakefile:

set_property(TARGET abc PROPERTY CXX_STANDARD 11)
set_property(TARGET abc PROPERTY CXX_STANDARD_REQUIRED ON)

这篇关于为什么随机标头不能导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆