Difficulty compiling with changed Include path

General questions regarding the usage of CodeLite
wittend
CodeLite Enthusiast
Posts: 44
Joined: Thu Oct 09, 2008 9:11 pm
Contact:

Difficulty compiling with changed Include path

Post by wittend »

I can't get codelite to ignore old include path and follow the new.
I am attempting to build a sample using wx2.9.5 rather than 2.9.4.

Any Suggestions?

Dave

Details:
---------
I changed environment vars, added paths for include & lib in both Debug and Release Settings.
I followed the instructions on 'The Configuration Manager' docs page and cloned & edited the release settings to a Release-(2.95) config.
I rebooted the machine
I tried both 'append to global' and 'overwrite global' options

Old include folder:
-IC:\bin\wxWidgets-2.9.4\include
New include folder (yes the files are in there):
-IC:/bin/MinGW-4.7.1/MSYS/1.0/local/include/wx-2.9

Note the peculiar placement of the include directives at the end of the g++ command line.

I am using Codelite 5.2 with Win 7.
Projects using wx2.9.4 work fine.
Path to workspace (7 project) is:
C:/bin/wxWidgets-2.9.5/samples/webview/wvgnu/
Path to only source file is:
C:/bin/wxWidgets-2.9.5/samples/webview/webview.cpp (above the project)

Environment variables:

Code: Select all

CodeLiteDir=C:\bin\CodeLite
UNIT_TEST_PP_SRC_DIR=C:\bin\UnitTest++-1.3
LIB=C:\bin\wxWidgets-2.9.5\lib\
INCLUDE=C:\bin\wxWidgets-2.9.5\include

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 2 -e -f  Makefile"
"----------Building project:[ wvg - Release-(2.95) ]----------"
mingw32-make.exe[1]: Entering directory `C:/bin/wxWidgets-2.9.5/samples/webview/wvgnu'
g++  -c  "C:/bin/wxWidgets-2.9.5/samples/webview/webview.cpp" -O2 -Wall -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -IC:\bin\wxWidgets-2.9.4\lib\gcc_dll\mswu -IC:\bin\wxWidgets-2.9.4\include -DWXUSINGDLL -Wno-ctor-dtor-privacy -pipe -fmessage-length=0 -fno-keep-inline-dllexport    -o ./Release/webview_webview.o -IC:/bin/MinGW-4.7.1/MSYS/1.0/local/include/wx-2.9  -IC:/bin/MinGW-4.7.1/MSYS/1.0/local/include/wx-2.9
C:/bin/wxWidgets-2.9.5/samples/webview/webview.cpp: In constructor 'WebFrame::WebFrame(const wxString&)':
C:/bin/wxWidgets-2.9.5/samples/webview/webview.cpp:285:19: error: 'wxWEBVIEW_FIND_DEFAULT' was not declared in this scope
C:/bin/wxWidgets-2.9.5/samples/webview/webview.cpp:414:35: error: 'wxWEBVIEW_ZOOM_TYPE_LAYOUT' was not declared in this scope
...etc...
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Difficulty compiling with changed Include path

Post by eranif »

codelite is using wx-config.exe to generate the compilation flags (include path + switches) required by wxWidgets
To make codelite point to the new wxWidgets installation, all you need to do is set the environment variable WXWIN to the new installation folder.

However, since you are using MSYS, I suggest that you remove the wx-config line from "project settings -> common settings -> compiler -> C++ compiler options"
it will be something like $(shell wx-config ...)

But when doing so, its up to you to set all the wxWidgets flags and include paths
(the wx-config.exe provided with codelite works with native builds of wx not for MSYS)

You can also try and download a pre-compiled wxWidgets 2.9.5 that will work with codelite's wx-config tool from here

Eran
Make sure you have read the HOW TO POST thread
wittend
CodeLite Enthusiast
Posts: 44
Joined: Thu Oct 09, 2008 9:11 pm
Contact:

Re: Difficulty compiling with changed Include path

Post by wittend »

Eran,

Thanks! I just didn't understand what was going on. I'll use the build you suggest. Is there any easy way to know the flags that were used for that build?

Dave
wittend
CodeLite Enthusiast
Posts: 44
Joined: Thu Oct 09, 2008 9:11 pm
Contact:

Re: Difficulty compiling with changed Include path

Post by wittend »

Eran,

FWIW my reason for messing with this is that I wanted to see if I could get wxChromiumWebView to work with g++. Probably won't work, but I wanted to see what would happen.

Dave
wittend
CodeLite Enthusiast
Posts: 44
Joined: Thu Oct 09, 2008 9:11 pm
Contact:

Re: Difficulty compiling with changed Include path

Post by wittend »

To my great embarrassment it seems that I write with a question related to this subject every few years.

This time, I am wanting to build against arbitrary clones of wxWidgets trunk from github. At present I am using Linux Mint, Codelite 9.04, and having difficulty overriding the use of the default wxWidgets on my system.

Altered include/link paths via the settings interface don't seem to do the job I want. Does the WXWIN environment variable apply in Linux? Or do I need to build an external cmake or automake definition for my project?

Thanks,

Dave
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Difficulty compiling with changed Include path

Post by eranif »

Hi,

You could do this:

- Create a workspace and project configuration per wxWidgets build
- Edit the settings for each configuration in the following manner:

1. Project settings->Compiler->C++ compiler option and change this line:

Code: Select all

$(shell wx-config --debug=no --cxxflags --unicode=yes)
to

Code: Select all

$(shell /path/to/my/wx-config --debug=no --cxxflags --unicode=yes)
(notice that I am using full path to wx-config)
2. Project settings->Linker->Linker options, same idea: replace wx-config => /path/to/my/wx-config

3. To avoid conflicts with objects, define a different Intermediate folder per build configuration from:
Project settings->General->Intermediate folder

Eran
Make sure you have read the HOW TO POST thread
Post Reply