News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

why doesn't code completion work for me?

Started by mrpringle, August 29, 2006, 01:23:06 PM

Previous topic - Next topic

mrpringle

hi,
From what i understand a lot of people have had success with the code completion, however I still cannot manage to get it to work with the mingw32 libraries, and wxwidgets.

I am using the 28/8 build of codeblocks, and wxwidgets 2.6.3.
Code completion won't work for me with wxwidgets full stop, or with the mingw32 windows libraries, like string, iostream, etc.

The only time code completion works for me, is if i create my own class and try calling a method from it.

Can someone please tell me what I need to do to get it working.

jarro_2783

I don't think that's all completely working yet. I'm getting the same thing. I'll just wait until they fix it properly.

MortenMacFly

Settings -> Editor -> Code Completion -> Tab "Parser":
Enable: "Follow local includes" and "Follow global includes".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mrpringle

I know, it's already turned on, any other suggestions?

Quote from: MortenMacFly on August 29, 2006, 07:50:26 PM
Settings -> Editor -> Code Completion -> Tab "Parser":
Enable: "Follow local includes" and "Follow global includes".

MortenMacFly

Quote from: mrpringle on August 30, 2006, 12:58:42 PM
I know, it's already turned on, any other suggestions?
Could you provide us with a simple example project, where CC does not work for you? ZIP it and attach it to another post, please.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mrpringle

Here's a sample project.
in main, I am unable to get autocomplete to work for the frame object.
If I type frame-> nothing appears,
If i type p-> nothing appears

If you go into main.cpp class, I can't find any of the wxwidget objects which autocomplete recognises.

Like I said already, autocomplete will work with my own classes, but no tthe wxwidgets or windows libraries.

[attachment deleted by admin]

sethjackson


mrpringle

Don't quite know what it means, but will it be in the future? Also people have told me that codeblocks has autocomplete for wxwidgets.

Quote from: sethjackson on August 31, 2006, 06:46:10 PM
AFAIK STL parsing isn't supported.....

sethjackson

Quote from: mrpringle on September 01, 2006, 02:00:05 AM
Don't quite know what it means, but will it be in the future? Also people have told me that codeblocks has autocomplete for wxwidgets.

Quote from: sethjackson on August 31, 2006, 06:46:10 PM
AFAIK STL parsing isn't supported.....

Well for one wxWidgets parsing works fine for me..

Well cc doesn't parse STL AFAIK so that explains why when you type p-> you don't get anything. ;)

mrpringle

why doesn't wxwidgets parsing work for me?
I compiled wxwidgets as a unicode dll

Any ideas?

sethjackson

Quote from: mrpringle on September 01, 2006, 10:15:12 AM
why doesn't wxwidgets parsing work for me?
I compiled wxwidgets as a unicode dll

Any ideas?

Yes actually. It may be a bug in the parser. However in your main.h header you included app.h when you should have done the normal


include <wx/wxprec.h>

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif



there really is no reason to include the app.h header in your main.h header AFAIK. :)

Game_Ender

When not using pre-compilied headers Including all of wx.h in every file that uses wxWidgets will result in slower compile times.  So if all you need was app.h in your file and you are using precompilied you could/should do something like this:
Code (cpp) Select

include <wx/wxprec.h>

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    // Only include the headers we need here
    #include <wx/app.h>
#endif

This will speed compile times because the compiler will not have to process almost every wxWidgets header when you only want one.

killerbot

precompilation headers : you only include them in implementation files, not in other header files !!!

mrpringle

I am not overly experienced in c++, and I have only made console applications, so the project I uploaded is just the default wxwidgets project generated by codeblocks, with some minor modifications to demonstrate how strings don't have code complete.

Will the standard library have code complete eventually? Or isn't it a goal of code completion?

sethjackson

Quote from: mrpringle on September 02, 2006, 02:24:55 AM
Will the standard library have code complete eventually? Or isn't it a goal of code completion?

I would venture to say that it would in the future. ;)