Code::Blocks 12.11 error: ‘nullptr’ was not declared in this scope&GNU GCC -std=gnu++0x



Code::Blocks 12.11 error: ‘nullptr’ was not declared in this scope&GNU GCC -std=gnu++0x

Aleeee’s blog
 

C + + primer English Version (Fifth Edition) P54 null points chapter: Modern C + + programs should generally use null and use nullptr instead. So we use code:: blocks to type the code, and the problem comes.

error: ‘nullptr’ was not declared in this scope

So Google answers on the Internet, a lot of English, and finally probably understand that it’s the GNU gcc compiler problem, not the IDE problem of code:: blocks. You just need to type the command line – STD = GNU + + 0x in the compiler. Solution: Code:: blocks integrates GNU gcc compiler, so menu bar – & gt; setting – & gt; compiler , select the global compiler settings page, select GNU gcc compiler at the top of the page, select compiler settings – & gt; compiler flags at the middle of the page, and check have G + + follow the coming C + + 0x ISO C + + language standard [- STD = GNU + + 0x]

Well, the next compilation will be successful! O(∩_ ∩)O~

Read More: