Author Topic: why doesn't code completion work for me?  (Read 9851 times)

mrpringle

  • Guest
why doesn't code completion work for me?
« 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.

Offline jarro_2783

  • Multiple posting newcomer
  • *
  • Posts: 99
    • Project Freedom
Re: why doesn't code completion work for me?
« Reply #1 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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: why doesn't code completion work for me?
« Reply #2 on: August 29, 2006, 07:50:26 pm »
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

mrpringle

  • Guest
Re: why doesn't code completion work for me?
« Reply #3 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".

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: why doesn't code completion work for me?
« Reply #4 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

mrpringle

  • Guest
Re: why doesn't code completion work for me?
« Reply #5 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]

sethjackson

  • Guest
Re: why doesn't code completion work for me?
« Reply #6 on: August 31, 2006, 06:46:10 pm »
AFAIK STL parsing isn't supported.....

mrpringle

  • Guest
Re: why doesn't code completion work for me?
« Reply #7 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.....

sethjackson

  • Guest
Re: why doesn't code completion work for me?
« Reply #8 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. ;)

mrpringle

  • Guest
Re: why doesn't code completion work for me?
« Reply #9 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?

sethjackson

  • Guest
Re: why doesn't code completion work for me?
« Reply #10 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. :)

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: why doesn't code completion work for me?
« Reply #11 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.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: why doesn't code completion work for me?
« Reply #12 on: September 01, 2006, 09:12:36 pm »
precompilation headers : you only include them in implementation files, not in other header files !!!

mrpringle

  • Guest
Re: why doesn't code completion work for me?
« Reply #13 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?

sethjackson

  • Guest
Re: why doesn't code completion work for me?
« Reply #14 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. ;)