User forums > Using Code::Blocks
Code completion with new compiler : no suggestion for header files and classes
Scr3amer:
Hello guys,
It has been 2 years now I discovered C::B (and I really appreciate it) and I start to get deeper in C++.
I wanted to try std::thread of C++11 and the bundled TDM 4.7.1 32 bits does not include it.
I downloaded MinGW 4.9.3 SEH POSIX 64 bits compiler and I created a new compiler in the IDE.
I added the right path and created a dummy test program. Here the fun begins ...
When i started to write #include and ctrl-space, no suggestions appeared for standard headers such as iostream or cstdlib.
I had to add the path to C:\MinGW64_4.9.3_POSIX_SEH\x86_64-w64-mingw32\include\c++ into the search directories of the compiler to have right headers.
And if I had C:\MinGW64_4.9.3_POSIX_SEH\x86_64-w64-mingw32\include\c++\tr1, the parser could not do its job because of same name header collision.
Well, I kept only the first path to avoid that collision and I had a partial but functional header autocompletion.
I then added thread header file but when i started to write "std::thr" and then ctrl-space, i had no std::thread suggestion.
I opened the thread file and it had no syntax color like if C::B did not detect it was a valid C++ header.
So no help at all to write my code. When I finally finished my little demo. The compilation went well... At least.
To sum up I have 2 questions :
1)Do we really need to add header folders for new compilers to have header autocompletion for #include (which may lead to suggestion collision and block autocompletion) ? Or is there a canonical way to set-up a new compiler and let C::B detect all the available headers inside the compiler folders and deal with same named headers ? Because in the provided settings of TDM 4.7.1 shipped with C::B, there is no header inclusion and the autocompletion still works and even deals properly with same named headers.
2)Is there a way for C::B to parse properly new headers content ? Or at least a way to force it, help it to do so ? To use the content of these headers in our code : classes, methods, etc.
Thanks in advance for any suggestion, help, idea, tips :-*
EDIT : I tried with <array>, same thing. When I write std::, no autocompletion. But something new this time, the header has the syntax color.
ollydbg:
Here is my test on my own build trunk code, I have a test project, which has "c++ 11" option enabled.
I tested on a 4.7.3 version of GCC (supplied from mingw-build)
See the four screen shot below:
1,
2,
3,
4,
Scr3amer:
:o
Wonderful ! Ok so I am the problem. What did I do wrong ?
Did you follow a guide to add the new compiler ? Or did you find your own way to do that ? Did you set include folders ? Did you put the compiler in a particular folder ?
When you say your own build trunk, what is its revision ? Can the problem come from the 13.12 version ?
And for c++11, you mean you just checked the right box in the build properties ?
That would be nice of you to have a link or steps to set properly a new compiler *-* !
Thank you for showing me that it is possible to do what I want, you did my day ^^.
oBFusCATed:
--- Quote from: Scr3amer on October 11, 2015, 04:50:22 pm ---Can the problem come from the 13.12 version ?
--- End quote ---
It is possible. Have you tried a nightly?
And 100% you don't need to add anything to the search path to get a completion for stl headers!
Scr3amer:
I tried with build 10503 win32.
I used i686-w64-mingw32-gcc-5.2.0 a sjlj POSIX 32 bit compiler.
And when I ran C::B, I had no autocompletion for header files again. But I think I found the reason : the compiler I downloaded does not respect the folder hierarchy of the 4.7.1 TDM.
For instance, iostream is in 5.2.0 : C:\MinGW\i686-w64-mingw32\include\c++
And in TDM 4.7.1 in C:\MinGW\lib\gcc\mingw32\4.7.1\include\c++
When I used TDM 4.7.1, I had again header autocompletion.
But when I used array with it, I activated c++11 in build properties and I still did not have autocompletion for array class >:( ... The code in the header was "grayed" like if the preprocessor condition of std=c++11 was not met.
I will try with 4.8.1 TDM and other compilers ...
ollydbg I need youuuuu ;D How did you do that ???
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.
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.
Navigation
[0] Message Index
[#] Next page
Go to full version