Author Topic: CodeBlocks 13.12 c++11 features code completion issue  (Read 7675 times)

Offline jeffsturmann

  • Single posting newcomer
  • *
  • Posts: 5
CodeBlocks 13.12 c++11 features code completion issue
« on: January 22, 2014, 01:49:49 am »
Hello,

Iīm using MinGW 4.8.1 thread-posix and CodeBlocks 13.12 (with c++11 flags)

The headers of C++11 canīt be found by IDE editor and the code completion doesnīt show
any suggestion to class members of the C++11 classes.

The most weird behavior, is that the program compiles and runs fine using the c++11 features
(although the editor doesnīt recognize it).

Some one can tell me how to fix it?

Offline EnterTheNameHere

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: CodeBlocks 13.12 c++11 features code completion issue
« Reply #1 on: January 23, 2014, 12:14:55 pm »
Fix is already in the repository, but I'm affraid no nightly build for Windows is available.

The easies DIY fix is adding:

__cplusplus 201103L
__GXX_EXPERIMENTAL_CXX0X__ 1

to Your project/compiler #defines tab, so the CC will include C++11 features when parsing headers.

GCC 4.8.1 doesn't recognise c++11 standard as experimental anymore and that's what causes this issue, since Code::Blocks parser was expecting only experimental headers.
« Last Edit: January 23, 2014, 12:17:13 pm by EnterTheNameHere »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5207
Re: CodeBlocks 13.12 c++11 features code completion issue
« Reply #2 on: January 23, 2014, 01:13:31 pm »
nightly build somewhere this weekend

Offline jeffsturmann

  • Single posting newcomer
  • *
  • Posts: 5
Re: CodeBlocks 13.12 c++11 features code completion issue
« Reply #3 on: January 25, 2014, 02:06:51 am »
I putted this two flags in #defines tab of Settings->Compiler of CodeBlocks.

But now, when i compile the program, a error is showed, saying "No such file or directory" twice (one for each flag, i think).

Someone (again) know how to solve this?

 ??? :-\


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9515
Re:
« Reply #5 on: January 25, 2014, 07:13:44 am »
Don't forget to declare defines as "FOO=BAR". Note the equality sign...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5224
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re:
« Reply #6 on: January 25, 2014, 10:11:46 am »
Don't forget to declare defines as "FOO=BAR". Note the equality sign...

OT, @Morten, I found that some of your reply has the subject "Re:", it that caused by design? Or a bug of Phone access interface of our forum?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9515
Re:
« Reply #7 on: January 25, 2014, 03:11:39 pm »
Or a bug of Phone access interface of our forum?
The latter.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ