Page 1 of 1

Help setting up code completion

Posted: Fri Oct 05, 2012 8:42 pm
by Zoran
Hello,

I am learning C++ and I want to start GUI programming with wxWidgets.

On Kubuntu 12.04, I have installed the compiler (through package build-essentials), then I have built wxWidgets 2.9.4 from source (as described in wxWidgets wiki article) and put it under some subfolder of my $HOME path.

Then I installed the IDE from CodeLite repository (as described here: http://www.codelite.org/LiteEditor/Repositories, I used repository for precise).

Everything went smoothly and I have CodeLite up and running (version 4.1.5770). However, the problem I have is that I do not know what are the paths that I should add to enable code completion. The example image on "configuring the parser" article shows some paths on Windows. This is different in Kubuntu. I do not even know where the g++ compiler is.
Could you help me?

Thank you,
Zoran

Re: Help setting up code completion

Posted: Fri Oct 05, 2012 9:42 pm
by eranif
Setting up completion to work with wxwidgets is easy:

configuring codelite's builtin parser:

- First, you need to tell codelite where wx is installed, to do this, run from the command line:

Code: Select all

wx-config --cflags
You will get an output similar to:

Code: Select all

-I/home/eran/wx294/build-release/lib/wx/include/gtk2-unicode-2.9 -I/home/eran/wx294/include -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXGTK__ -pthread
So now you know where wxWidgets placed its header files:
/home/eran/wx294/build-release/lib/wx/include/gtk2-unicode-2.9
/home/eran/wx294/include

Go to:
Settings -> Tags Settings -> ctags
and copy both paths to the first text area (the one with the title: "Add search path(s) for the parser")

click OK

Now, you need to force a full reparsing (this is needed only once):
from the menu: Workspace -> Retag workspace (full)

From this point on, codelite will be able to code complete all your code


Another option:
Enable clang code completion (in addition to the above steps):
Settings -> Tags Settings -> clang -> enable clang code completion

For clang to work, you simply need to rebuild your workspace once.

code completion is triggered when you type . -> or ::
You can also force it by hitting Ctrl-SPACE

Eran

Re: Help setting up code completion

Posted: Sat Oct 06, 2012 9:37 am
by Zoran
Thank you. :)