Jeroen
Jeroen

Reputation: 16865

Netbeans "__cplusplus" Defined Wrong

In my Ubuntu Netbeans 7.3 installation, I have a C++ project with C++11 marked as the standard in the C++ Compiler Options. When I try to include <chrono> it does not seem to make the std::chrono namespace available. When I open up this file to see what's wrong, I see everything greyed out but his first section:

#ifndef _GLIBCXX_CHRONO
#define _GLIBCXX_CHRONO 1

#pragma GCC system_header

#if __cplusplus < 201103L
# include <bits/c++0x_warning.h>
#else

When I hover over the __cplusplus constant, to see how it was defined, it says it's defined as 199711L. Why is this? I clearly set the project C++ Standard to C++11.

Upvotes: 0

Views: 1356

Answers (1)

eigil
eigil

Reputation: 96

  1. Go to Tools->Options
  2. Select C/C++ menu
  3. Select Code Assistance tab
  4. Select C++ Compiler tab
  5. In Macro Definitions list view, locate __cplusplus and change its value to 201103L
  6. Click OK button

Upvotes: 2

Related Questions