Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: mrpringle on August 29, 2006, 01:23:06 pm

Title: why doesn't code completion work for me?
Post by: mrpringle on August 29, 2006, 01:23:06 pm
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.
Title: Re: why doesn't code completion work for me?
Post by: jarro_2783 on August 29, 2006, 02:38:12 pm
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.
Title: Re: why doesn't code completion work for me?
Post by: MortenMacFly on August 29, 2006, 07:50:26 pm
Settings -> Editor -> Code Completion -> Tab "Parser":
Enable: "Follow local includes" and "Follow global includes".
Title: Re: why doesn't code completion work for me?
Post by: mrpringle on August 30, 2006, 12:58:42 pm
I know, it's already turned on, any other suggestions?

Settings -> Editor -> Code Completion -> Tab "Parser":
Enable: "Follow local includes" and "Follow global includes".
Title: Re: why doesn't code completion work for me?
Post by: MortenMacFly on August 30, 2006, 01:24:30 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.
Title: Re: why doesn't code completion work for me?
Post by: mrpringle on August 31, 2006, 01:38:10 pm
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]
Title: Re: why doesn't code completion work for me?
Post by: sethjackson on August 31, 2006, 06:46:10 pm
AFAIK STL parsing isn't supported.....
Title: Re: why doesn't code completion work for me?
Post by: 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.

AFAIK STL parsing isn't supported.....
Title: Re: why doesn't code completion work for me?
Post by: sethjackson on September 01, 2006, 02:58:41 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.

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. ;)
Title: Re: why doesn't code completion work for me?
Post by: 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?
Title: Re: why doesn't code completion work for me?
Post by: sethjackson on September 01, 2006, 06:10:33 pm
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

Code
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. :)
Title: Re: why doesn't code completion work for me?
Post by: Game_Ender on September 01, 2006, 08:16:18 pm
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
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.
Title: Re: why doesn't code completion work for me?
Post by: killerbot on September 01, 2006, 09:12:36 pm
precompilation headers : you only include them in implementation files, not in other header files !!!
Title: Re: why doesn't code completion work for me?
Post by: mrpringle on September 02, 2006, 02:24:55 am
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?
Title: Re: why doesn't code completion work for me?
Post by: sethjackson on September 02, 2006, 02:58:28 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. ;)