wxWidget static libraries + codelite 5.4

CodeLite installation/troubleshooting forum
antwerpen
CodeLite Curious
Posts: 4
Joined: Mon Jan 20, 2014 6:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

wxWidget static libraries + codelite 5.4

Post by antwerpen »

Hello,
I am trying to compile a test project in codelite IDE, and this project is a GUI wxfb Frame based project. I am workin under a WINDOWS 7 environment.

What I have done until now:

1) I installed codelite 5.4 + UnitTest++ + MinGW-4.8.1.

2) I downloaded the source code of wxWidget 3.0.0 (but I also tried 2.8.12) and I compiled with the following command from the directory C:\wxWidget-3.0.0\build\msw\ :

Code: Select all

"C:\MinGW-4.8.1\bin\mingw32-make.exe" -f makefile.gcc UNICODE=1 SHARED=0 MONOLITHIC=1 BUILD=RELEASE
3) The output was a series of files (libraries, build.cfg and .h) contained in the folder: "C:\wxWidgets-3.0.0\lib\gcc_lib\mswu". I copied the "setup.h" file in the "include\wx" directory in the wxWidgets path.

4) I created a new project in my workspace, based on GUI wxfb Frame.

5) I set the following environment variables:

WXWIN=C:/wxWidgets-3.0.0/
WXCFG=gcc_lib/mswu/

6) I tried to compile (Rebuild) the project obtaining:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 8 -e -f  Makefile"
"----------Building project:[ test1_wxfbFrame - Debug ]----------"

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.

Please use the --wxcfg flag (as in wx-config --wxcfg=gcc_dll/mswud)
or set the environment variable WXCFG (as in WXCFG=gcc_dll/mswud)
to specify which configuration exactly you want to use.
mingw32-make.exe[1]: Entering directory 'C:/CodeLite/myworkspace/test1_wxfbFrame'
windres -i "C:/CodeLite/myworkspace/test1_wxfbFrame/win_resources.rc" --use-temp-file --define __WXMSW__ --define _UNICODE --include-dir C:/wxWidgets-3.0.0/lib/gcc_lib/mswu --include-dir C:/wxWidgets-3.0.0/include    -o ./Debug/win_resources.rc.o
g++: error: wx-config: No such file or directory
g++: error: Error:: Invalid argument
g++: error: No: No such file or directory
g++: error: valid: No such file or directory
g++: error: setup.h: No such file or directory
g++: error: of: No such file or directory
g++: error: wxWidgets: No such file or directory
g++: error: has: No such file or directory
g++: error: been: No such file or directory
g++: error: found: No such file or directory
g++: error: at: No such file or directory
g++: error: location:: Invalid argument
g++: error: C:/wxWidgets-3.0.0/lib/gcc_lib/mswud/wx/setup.h: No such file or directory
mingw32-make.exe[1]: *** [Debug/gui.o.d] Error 1
mingw32-make.exe[1]: *** Waiting for unfinished jobs....
g++: error: wx-config: No such file or directory
g++: error: Error:: Invalid argument
g++: error: No: No such file or directory
g++: error: valid: No such file or directory
g++: error: setup.h: No such file or directory
g++: error: of: No such file or directory
g++: error: wxWidgets: No such file or directory
g++: error: has: No such file or directory
g++: error: been: No such file or directory
g++: error: found: No such file or directory
g++: error: at: No such file or directory
g++: error: location:: Invalid argument
g++: error: C:/wxWidgets-3.0.0/lib/gcc_lib/mswud/wx/setup.h: No such file or directory
mingw32-make.exe[1]: *** [Debug/main.o.d] Error 1
test1_wxfbFrame.mk:99: recipe for target 'Debug/gui.o.d' failed
test1_wxfbFrame.mk:107: recipe for target 'Debug/main.o.d' failed
windres: warning: 24: 1: 1033: duplicate value
mingw32-make.exe: *** [All] Error 2
mingw32-make.exe[1]: Leaving directory 'C:/CodeLite/myworkspace/test1_wxfbFrame'
Makefile:4: recipe for target 'All' failed
0 errors, 0 warnings

Clearly there is something I am missing, since the output points to a "mswud" folder I don't have!!!

What did I miss?
rro4785
CodeLite Curious
Posts: 7
Joined: Sun Mar 03, 2013 3:31 am
Genuine User: Yes
IDE Question: C++
Location: Caracas, Edo. Miranda. Venezuela
Contact:

Re: wxWidget static libraries + codelite 5.4

Post by rro4785 »

Hi!

You just need change this variable value:

Code: Select all

WXCFG=gcc_lib/mswu/
to:

Code: Select all

WXCFG=gcc_lib/mswud/
In this directory it is the build.cfg file. if you don't have it, then I recommended to you download the precompiled option from here:

http://sourceforge.net/projects/wxwindo ... /binaries/

and header from here:

http://sourceforge.net/projects/wxwindows/files/3.0.0/

For developing applications with wxWidgets you need to download the compiler-independent wxWidgets-3.0.0_Headers.7z file and one of wxMSW-3.0.0-vcXXX_Dev.7z or wxMSW-3.0.0_gccXXX_Dev.7z files depending on your compiler, its version and the target architecture (x86 if not specified or x64).

Unpack both files into the same directory so that "include" and "lib" directories are at the same level after unpacking. You should be able to compile and link applications using wxWidgets in both debug and release modes but the debug symbols are provided only for debug libraries in this archive, see below for the release build debug symbols.
antwerpen
CodeLite Curious
Posts: 4
Joined: Mon Jan 20, 2014 6:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidget static libraries + codelite 5.4

Post by antwerpen »

Hello,
actually after a bit of trial and error I made it work.

My environment settings are these:

Code: Select all

CodeLiteDir=C:\CodeLite
WXWIN=C:\wxWidgets-3.0.0
PATH=$(WXWIN)\lib\gcc_dll;$(PATH)
WXCFG=gcc_dll\mswu
UNIT_TEST_PP_SRC_DIR=C:\UnitTest++-1.3
With these settings I can compile my application that uses wxWidgets in a static way.
I don't exactly know why I had these problems, but I am quite sure that installing the already compiled wxWidgets saved me a lot of time. I have doubt about MinGW being installed correctly (after I had problems with other libs I tried to compile and after some re/installation I solved it).

And now I am in the world of codelite... thanks!!!!
frank_frl
CodeLite Expert
Posts: 176
Joined: Sun Aug 17, 2008 2:45 pm
Contact:

Re: wxWidget static libraries + codelite 5.4

Post by frank_frl »

antwerpen wrote:Hello,
actually after a bit of trial and error I made it work.

My environment settings are these:

Code: Select all

CodeLiteDir=C:\CodeLite
WXWIN=C:\wxWidgets-3.0.0
PATH=$(WXWIN)\lib\gcc_dll;$(PATH)
WXCFG=gcc_dll\mswu
UNIT_TEST_PP_SRC_DIR=C:\UnitTest++-1.3
With these settings I can compile my application that uses wxWidgets in a static way.
I don't exactly know why I had these problems, but I am quite sure that installing the already compiled wxWidgets saved me a lot of time. I have doubt about MinGW being installed correctly (after I had problems with other libs I tried to compile and after some re/installation I solved it).

And now I am in the world of codelite... thanks!!!!
AFAIK the prebuild binaries are shared builds only of wxWidgets and your path above is pointing to a wxWidgets dll.
To use your self build static libraries just change your compiler and linker settings to something like this:

Code: Select all

Compiler: -O3;-Wall;$(shell wx-config --wxcfg=gcc_lib/mswu --cflags)
Linker: -s;$(shell wx-config --wxcfg=gcc_lib/mswu --libs);-mwindows 
Regards

Frank
antwerpen
CodeLite Curious
Posts: 4
Joined: Mon Jan 20, 2014 6:08 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxWidget static libraries + codelite 5.4

Post by antwerpen »

Hello,
in the end I was capable of building the static libraries of wxwidgets 3.0.0, and link them with my project. I report a bit of my work here for others to know.
First thing I did was clean everything up.
So I downloaded the sources of wxwidgets 3.0.0, I read the instruction of "install.txt" in the "docs/msw" directory, and I did the following commands in the "build/msw" directory.

Clean:

Code: Select all

make -f makefile.gcc clean
Build static libraries (and release):

Code: Select all

make -f makefile.gcc BUILD=RELEASE STATIC=1 SHARED=0
Then I I did the same thing in the "samples/minimal" folder of the wxwidgets. When I was able to execute the "minimal.exe", I understood that I had no problems with the compilation of wxwidgets at all (as I thought before), but with the settings and/or the compiler of Codelite.
Actually, the real problem was that I used a different version of MinGW respect to the default one of Codelite, also if I thought they were practically the same.

So the solution to the issue was to use the same MinGW, or compiling the wxwidgets libraries with the MinGW of Codelite or switching the MinGW to mine. The latter was what I did, also reading the following excellent post:

http://forums.codelite.org/viewtopic.php?f=11&t=2388

In the end, using the right environment and project settings I managed to build my executables.

Thanks to everyone for the suggestions.

Regards,
Antwerpen.
Post Reply