Author Topic: Why is codeblocks not throwing a consistent error here?  (Read 2452 times)

Offline AntiElephant

  • Single posting newcomer
  • *
  • Posts: 6
Why is codeblocks not throwing a consistent error here?
« on: January 28, 2016, 06:43:46 pm »
I recently installed Ubuntu 15.10 and installed codeblocks from the repository.

The g++ version that came with Ubuntu is reported in the terminal as 5.2.1.


I went to test out that Code::Blocks is running the right g++ version, I know there is an error in earlier versions of g++ where default constructors ignore the private access specifier. This is sorted out by 5.2.1. I tested this out by compiling in the command line, which throws an error as expected since I'm running 5.2.1. However when I run this through code blocks there is no error? This is odd because the compiler settings show it is using the exact same compiler so I can't figure out why. I also made sure to select the -std=c++11 flag.

This image shows what I mean:



The terminal does not compile. But codeblocks, shown to use the exact same compiler, does. What could be wrong here? (And yes the project is also using the GCC compiler).
« Last Edit: January 28, 2016, 06:50:11 pm by AntiElephant »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Why is codeblocks not throwing a consistent error here?
« Reply #1 on: January 28, 2016, 07:25:24 pm »
On Linux, you often have several compilers installed. Please compare the compiler by the FULL PATH name, not only the executables name. Use "which g++" on the console and check the compiler settings in Code::Blocks.

Make the same with "test.cpp".

Also, enable and show the FULL build log, if you need more help.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline AntiElephant

  • Single posting newcomer
  • *
  • Posts: 6
Re: Why is codeblocks not throwing a consistent error here?
« Reply #2 on: January 28, 2016, 08:13:16 pm »
I think I did something wrong with the building.

I rebuilt the project and I got the error message as usual.

Sorry, should've tried that at the start but didn't occur to me.