Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
564 views
in Technique[技术] by (71.8m points)

c++ - gcc 4.7 Give me error message

I have Debian 6.04 , and the latest gcc version included is gcc 4.4 , and this version doesn't support C++11 , and i look for another version support C++11 ( some features not completely supported ) , so i follow this Page

I suggest to install it and My NetBeans IDE succeeded to find gcc 4.7 andlink it , but when i compile the code using a test by using std::unique_ptr i get this error message :

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.

i found the error source and her is :

bits/c++0x_warning.h

#ifndef _CXX0X_WARNING_H
#define _CXX0X_WARNING_H 1

#ifndef __GXX_EXPERIMENTAL_CXX0X__
#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.
#endif

#endif
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The error says it all. Trying adding -std=c++11 or -std=gnu++11 to the compiler options in your NetBeans IDE.

I've not used Netbeans but see this link where a snapshot of build variables is shown and that is where you need to add the compiler options.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...