Why I cannot access C++ 11?

Hi, I am trying to include some utility from what I understand is the C++ 11 addition to C++.
Specifically, I wrote the following, where I ask to include <tuple>:

1
2
3
4
5
6
#include <iostream>
#include <map>
#include <list>
#include <tuple>

using namespace std;


However, as I build the program (I use CodeBlocks), a new window opens with a strange message:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/c++0x_warning.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{iosfwd}
 */

#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 


So what exactly is the problem and what exactly should I do to obtain <tuple>??
It means that the complier bundled with your version of the C::B IDE is pre-C++11. Uninstall the current C::B and download the latest version which is not only C++11 but even C++14 compliant (to a large extent)
The text in the OP explains the solution:

must be enabled with the -std=c++11

Not sure how to do this in Code::Blocks, somewhere you should be able to specify compiler options, that's where you need to put:
-std=c++11
how to do this in Code::Blocks

Settings -> Complier Settings -> Other Compiler Options - put it in the text box here but if that still doesn't work you'd need to install latest C::B
Topic archived. No new replies allowed.