vignette

Config Code::Blocks

vignette

fr flag

 

---------------------------------------------
Preparing code::blocks
---------------------------------------------

For a 32 bits Windows target
Configure a new compiler with an explicit name (e.g cross_compil_win32 )
Settings->Compiler then copy the default compiler and give it the new name.
Fetch the executables in the /usr directory
For C :i686-w64-mingw32-gcc
For C++ :i686-w64-mingw32-g++
linker for dynamic lib:i686-w64-mingw32-g++ (!!! not gcc)
linker for static lib: i686-w64-mingw32-ar
ressources compiler`/opt/Persowx310_Win32/bin/wx-config --host=i686-w64-mingw32 --rescomp`

For a 64 bits Windows target
Configure a new compiler with an explicit name (e.g cross_compil_win64 )
Settings->Compiler then copy the default compiler and give it the new name.
Fetch the executables in the /usr directory
pour C :x86_64-w64-mingw32-gcc
pour C++ :x86_64-w64-mingw32-g++
linker for dynamic lib:x86_64-w64-mingw32-g++ (!!! pas gcc)
linker for static lib: x86_64-w64-mingw32-ar
ressources compiler`/opt/Persowx310_Win64/bin/wx-config --host=x86_64-w64-mingw32 --rescomp`

For each compiler used in cross-compiling add in "linker other options" -static (to limit the dependancies)

---------------------------------------------
Tailoring the config file for each application (code::blocks cbp file)
---------------------------------------------

It's quicker to directly edit the cbp file in your pet text editor.
In the application's "cbp" file Set the path to wx-config in agreement with the chosen target.
For each of wxWidgets builds, this path is the "prefix" used at "configure" time.
Examples

For < Target title="ReleaseStatic310"> (To produce a Linux application based on wxWidgets 3.1.0)
In Compiler options :
< Add option="`/opt/Persowx310_Lin64/bin/wx-config --static --cflags --unicode=yes`" />
In linker options :
< Add option="`/opt/Persowx310_Lin64/bin/wx-config --unicode=yes --static --libs`" />

For < Target title="ReleaseWinStatic310_32"> (To produce a Windows 32bits application based on wxWidgets 3.1.0)
You need to specify the correct compiler in place of gcc :< Option compiler="cross_compil_win32" >
In Compiler options :
< Add option="`/opt/Persowx310_Win32/bin/wx-config --host=i686-w64-mingw32 --static --cflags --unicode=yes`" />
In linker options :
< Add option="`/opt/Persowx310_Win32/bin/wx-config --host=i686-w64-mingw32 --static --libs --unicode=yes`" />

For < Target title="ReleaseWinStatic310_64"> (To produce a Windows 64bits application based on wxWidgets 3.1.)
You need to specify the correct compiler in place of gcc :< Option compiler="cross_compil_win64" >
In Compiler options :
< Add option="`/opt/Persowx310_Win64/bin/wx-config --host=x86_64-w64-mingw32 --static --cflags --unicode=yes`" />
In linker options :
< Add option="`/opt/Persowx310_Win64/bin/wx-config --host=x86_64-w64-mingw32 --static --libs --unicode=yes`" />


Some issues if RichText functions are involved. This workaround seems to work (but it smacks of tinkering).
In the linker options, you need to add : std,richtext
< Add option="`/opt/Persowx310_Win32/bin/wx-config --host=i686-w64-mingw32 --static --libs std,richtext --unicode=yes`" /> pour 32 bits
< Add option="`/opt/Persowx310_Win64/bin/wx-config --host=x86_64-w64-mingw32 --static --libs std,richtext --unicode=yes`" /> pour 64 bits
In normal compiling you need to add -lexpat
< Add option="`/opt/Persowx310_Lin64/bin/wx-config --unicode=yes --static --libs std,richtext`" />
< Add option="-lexpat" />

The "ProjectMiniMini" does ... a minimum, but the sources provide an example of cbp file.

 

Home