0

In C++ Builder (Berlin) the editor's syntax highlighter shows nullptr as a reserved word. But when compiling I get the error:

Undefined symbol 'nullptr'

nullptr was added to the C++11 standard and as far I know, C++ Builder Berlin supports C++11. I have been browsing the C++ Compiler options but can't find anything related to selecting what C++ standard to use.

Is nullptr not supported in C++ Builder Berlin and the highlighter is just buggy? Or can I turn on C++11 support somewhere?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
Max Kielland
  • 5,627
  • 9
  • 60
  • 95
  • 2
    Have you already tried this: https://forums.embarcadero.com/thread.jspa?messageID=872315&tstart=0 ? – Bob__ Apr 15 '18 at 21:56
  • Ahh! I always have a hard time to find my way on Embarcadero's site. I usually google or check SO instead ;) Can you write down the steps so I can mark it as the solution and you get your reps? – Max Kielland Apr 15 '18 at 22:40
  • 1
    Well, I don't have that IDE installed, so I can't check any of those steps. My "answer" couldn't be nothing more than some quotes from that link. On the other hand, *you* could post an answer to your own question, if you managed to solve the issue. – Bob__ Apr 15 '18 at 22:46
  • I thought that was understood that your link solved it. But if you can't verify it yourself and don't feel comfortable with just writing an answer without testing it's fine. I can write my own version in 2 days (unless you have written one). – Max Kielland Apr 15 '18 at 23:12

1 Answers1

3

as far I know, C++ Builder Berlin supports C++11.

To be more accurate, only its Clang-based compilers support C++11. The "classic" Windows 32-bit compiler does not.

When compiling for Windows 32-bit, you can specify in the Project Options whether to use the Classic or Clang compiler. Per Embarcadero's documentation:

How to use the Clang-based compiler for Windows 32-bit projects:

BCC32C and BCC32X do not replace BCC32, RAD Studio gives you the option to choose the compiler for each of your projects. BCC32 is the default C++ compiler for 32-bit Windows.

To enable BCC32C or BCC32X for a specific project, select Project > Options > C++ Compiler and disable the Use 'classic' Borland compiler option under Classic Compiler.

The IDE will now use the Clang-enhanced Win32 compiler.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770