Reputation: 885
I am currently using CodeLite for my IDE for C++. There are many features in the IDE that I enjoy using and the interface is pretty simple.
Recently, I am moving my code for wxWigets from 3.0 to 3.1. There are a number of functions that are exclusive to 3.1 that I find will be most helpful in developing my C++ applications. Most notable, the wxWindow::FromDIP function.
I was able to grab the wxWidgets source from online and compile it successfully. I right clicked on the project folder, went to the C++ compiler settings and made sure to include the location of my compiled wx-3.1 library (which is /usr/local/include/wx-3.1).
As a test, I added in the FromDIP() function in some parts of the code. The code completion was able to pick up what i was typing and it was able to "see" the FromDIP() function.
When I went to build the project, the build failed at all points that I had the FromDIP function. IT was saying that it wasn't recognizable.
I then went to the Global compiler settings (Settings->Build Settings->(Choose my compiler)->Advanced) and I added in the include path to my wx-3.1 compiled library.
Again, the build failed. I then when back into the project C++ compiler settings and set the Global settings to override the project settings.
Again, the build failed.
I looked what GCC was outputting:
/usr/bin/g++-4.9 -c "/home/phillip/GitHub/Omni-FEM/src/UI/BoundaryDialog/BoundaryDialog.cpp" -g -O0 -fopenmp -std=c++11 -Wall -lglut -lGL -lGLU -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -o ./Debug/src_UI_BoundaryDialog_BoundaryDialog.cpp.o -I/home/phillip/GitHub/Omni-FEM/Include -I/usr/local/include/wx-3.1 -I/usr/include/wx-3.0-unofficial -I/usr/include/GL -I/usr/local/include/wx-3.1
There is a rogue -I/usr/inlcude/wx-3.0 compiler setting. I believe that this compiler setting is overriding the one where I want to have the wx-3.1 (you see that option appear later). Of course, the build will fail because if CodeLite tries to compile with 3.0, the function doesn't exist. I have been looking through all of the menus to find where this setting is and I have not found anything.
My question is this, is there some other place that I need to change the compiler setting and if so, where can I find it? Or, do I need to do something else? Like override some settings somewhere?
Upvotes: 2
Views: 2159
Reputation: 2400
By default, CodeLite uses wx-config
tool to get the correct paths and definitions needed by the compiler.
All you need to do is make sure that the correct wx-config
tool is used.
To do so, just type from the terminal wx-config --cflags
and see which flags are being printed to the terminal.
You don't (and should not) manually add the compiler paths, just in:
Project Settings->Compiler->Compiler options
make sure you have $(shell wx-config --cxxflags)
and in Project settings->Linker->Linker options
make sure you have $(shell wx-config --libs)
About the global paths: You should not add these unless you really know what you are doing. Theses paths are used for all workspaces, even those not related to wxWidgets. All the project settings should be set in the workspace level (this way if you share your project with other people they could benefit from your settings as well)
In case you have multiple wxWidgets installations you need to make sure that the correct wx-config
is used. To do this you can do one of the followings:
/usr/loca/bin/wx-config
to be used, update the PATH
environment variable in CodeLite from Settings->Environment variables
by adding this line PATH=/usr/local/bin:$PATH
wx-config
so in Project Settings->Compiler->Compiler Options
use this option $(shell /usr/local/bin/wx-config --cxxflags)
(do the same in Project settings->Linker->Linker Options
)Upvotes: 3