User forums > Using Code::Blocks

Code completion with new compiler : no suggestion for header files and classes

<< < (2/4) > >>

ollydbg:

--- Quote from: Scr3amer on October 11, 2015, 06:52:05 pm ---EDIT :
I tried with C::B 4.8.1, C::B 10503 and same MinGW 4.7.3 as ollydbg, I even tried to modify the folder hierarchy but ofcourse the compiler was lost.

--- End quote ---
I didn't modify the folder hierarchy.


--- Quote ---I tried on Ubuntu 15.04  with gcc 4.9.2, same thing, you dont have autocompletion for thread, array etc ...
I have no more ideas to obtain this proper autocompletion.

--- End quote ---
Normally, if you have "enabled the C++" option in your project or target, then CC will use this option to obtain the correct predefined macros, such as __cplusplus__, which could reflect the C++11 option. Then the parser can parse something like:

--- Code: ---#if _cplusplus__ > 20110301
#include <thread>
#endif

--- End code ---
thus, the header file is parse by our CC's parser.

If you can build C::B from trunk, you can see all the workflows of our CC.

Scr3amer:
I will try to checkout the latest revision and build it with MinGW 5.2.0. I think that will be painful as it is the first time I do that ^^.

osdt:

--- Quote from: Scr3amer on October 11, 2015, 03:40:54 am ---I downloaded MinGW 4.9.3 SEH POSIX 64 bits compiler and I created a new compiler in the IDE.

--- End quote ---

Make sure the new compiler name contains 'GCC' somewhere. Otherwise it may not be recognized as 'GCC based'.

@ollydbg: I've seen some hardcoded 'if (Compiler::GetID().Contains("gcc"))' somewhere in the codebase, don't remember where. Maybe Compiler::GetParentID() could be combined within such conditions.

Scr3amer:
Yo osdt,

Thanks for your suggestion. I tried renaming the "classic" MinGW build I DL and the one provided by Qt but in both cases, auto-detection fails.
Maybe the way C::B was designed, it recognizes efficiently only TDM compilers files names.

But what I mean is that the biggest problem is not the auto detection failure itself. It is the fact than even if you provide the right folder and executables path for the compiler, even if you check c++11 in the flags, CC does not autocomplete headers names and classes (classic ones or c++11). In my case at least. I tried with 4 computers since Friday.

The classic ones work in my case only when I use the provided TDM compiler. And c++11 CC fails even with provided compilers.

osdt:

--- Quote from: Scr3amer on October 12, 2015, 08:22:09 pm ---Thanks for your suggestion. I tried renaming the "classic" MinGW build I DL and the one provided by Qt but in both cases, auto-detection fails.
Maybe the way C::B was designed, it recognizes efficiently only TDM compilers files names.

--- End quote ---

I was talking about the C::B Compiler Name (the default is 'GNU GCC Compiler'). Make a copy (Settings->Compiler->GNU GCC Compiler and hit Copy), name it 'MinGW GCC' or something. Now edit the 'Compilers installation directory' and everything should work.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version