Page 1 of 1

wxWidgets 2.9.5 and Custom Location

Posted: Fri Mar 22, 2013 4:37 pm
by iwbnwif
Hello, sorry for a newbie question but I would like to try a couple of things with wxWidgets 2.9.5.

I have downloaded and built it in a custom location

/home/iwbnwif/wxWidgets-2.9.5/gtk-build

Everything is there, I can compile and run the samples correctly. However CL is still using the standard include files and libraries, even though I have changed:

Settings->Build Settings->Compilers->gnu g++->Advanced

Include Path: /home/iwbnwif/wxWidgets-2.9.5/include
Libraries Path: /home/iwbnwif/wxWidgets-2.9.5/gtk-build/lib

Workspace->Active Project Settings->Common Settings->Compiler:

Include paths: /home/iwbnwif/wxWidgets-2.9.5/include

Workspace->Active Project Settings->Common Settings->Linker:
Library Paths: /home/iwbnwif/wxWidgets-2.9.5/gtk-build/lib

Is there somewhere else I have missed or is it that I have to do something such that CL uses the correct wxconfig?

Thanks!

Re: wxWidgets 2.9.5 and Custom Location

Posted: Fri Mar 22, 2013 5:42 pm
by eranif
iwbnwif wrote:/home/iwbnwif/wxWidgets-2.9.5/gtk-build

Everything is there, I can compile and run the samples correctly. However CL is still using the standard include files and libraries, even though I have changed:

Settings->Build Settings->Compilers->gnu g++->Advanced

Include Path: /home/iwbnwif/wxWidgets-2.9.5/include
Libraries Path: /home/iwbnwif/wxWidgets-2.9.5/gtk-build/lib
You should not add hard coded paths like this (when using wxWidgets)

codelite uses the wx-config tool to get the location of the libraries etc
under project settings -> compiler you will see in the options field the following line:

Code: Select all

$(shell wx-config --cflags) 

(or something similar)

this is the line that "tells" the compiler the location of the include files.
You simply needs to make sure that the wx2.9.5 is used and not the default one.

So.. you only need to make sure that /home/iwbnwif/wxWidgets-2.9.5/gtk-build/wx-config is in the path *before* the default wx-config.

You can do this from within codelite in 2 ways:

1) The global way:
Settings -> Environment variables

And add the following line:

Code: Select all

PATH=/home/iwbnwif/wxWidgets-2.9.5/gtk-build/:$PATH
2) Per project:
Project Settings -> Environment
and add the same line:

Code: Select all

PATH=/home/iwbnwif/wxWidgets-2.9.5/gtk-build/:$PATH
Eran

Re: wxWidgets 2.9.5 and Custom Location

Posted: Fri Mar 22, 2013 6:24 pm
by iwbnwif
Eran, many thanks once again - that works perfectly :D

One short (related) question, am I correct to add required libraries for the project under:

Workspace->Show Active Project Settings->Linker

Libraries: libwx_gtk2u_unofficial_aui-2.9;libwx_gtk2u_unofficial_ribbon-2.9 etc.

?

Re: wxWidgets 2.9.5 and Custom Location

Posted: Fri Mar 22, 2013 6:40 pm
by eranif
Libraries (again, for wxWidgets) are added using the wx-config tool


For example, to add "ribbon" library, use the following line under project settings -> Linker -> Options:

Debug:

Code: Select all

$(shell wx-config --libs std,ribbon --debug=yes)
Release:

Code: Select all

$(shell wx-config --libs std,ribbon --debug=no)
Eran

Re: wxWidgets 2.9.5 and Custom Location

Posted: Fri Mar 22, 2013 7:16 pm
by iwbnwif
Perfect, sorry - I realise these are basic wxWidgets questions, not specific to CL.

Thanks anyway - up and running well now!