Page 1 of 1

how to cross-compile the wxWidgets in linux

Posted: Fri Dec 08, 2017 9:38 am
by ceejliu
Hi,
My environment configuration:
Build Operation System:Ubuntu 16.04 64bit
IDE Tool: code::blocks 13.12
cross-compiler: arm-linux-gnueabihf
wxwidgets 3.0.3

Target board: ZedBoard RevC
Target Operation System: embedded Linux 3.6.0

I need to use the code::blocks13.12 with wxwidgets (running in the Ubuntu 16.4 64bit) to develop UI to run in the target board.
How to configure the cross-compile the wxwidgets and configure the code:blocks.

Re: how to cross-compile the wxWidgets in linux

Posted: Fri Dec 08, 2017 1:35 pm
by coderrc
I dont know anything about codeblocks as I do all my builds from command line, but for me, I had to patch a bunch of stuff related to wxconfig
NOTE: it may not be this complicated, but as soon as I got it to work, I quit working on it and moved on with my life.

for whichever git commit of wx3.1 im using:
in makefile.in on line 14716

Code: Select all

(cd $(DESTDIR)$(bindir) && rm -f wx-config && $(LN_S) $(libdir)/wx/config/$(TOOLCHAIN_FULLNAME) wx-config || cp -p $(DESTDIR)$(libdir)/wx/config/$(TOOLCHAIN_FULLNAME) wx-config)
needed to be changed such that it pointed to the crosscompiler libdir rather than the build-box libdir
something like

Code: Select all

(cd $(DESTDIR)$(bindir) && rm -f wx-config && $(LN_S) $(My_CROSS_LIBDIR)/wx/config/$(TOOLCHAIN_FULLNAME) wx-config)
then after wxwidgets is built, (but before make install) you need to overwrite the wx-config "proxy script" in the build directory with the "real" wxconfig

you will also need to make sure that inside your crosscompiler's "libdir/wx/config" directory that you replace all the

Code: Select all

includedir="/usr/include"
libdir="/usr/lib"
with your crosscompiler's libdir and include dir so wxwidgets doesnt try to build against your local libs.

Re: how to cross-compile the wxWidgets in linux

Posted: Tue Dec 26, 2017 5:53 am
by ggbutcher
In Ubuntu with mingw-w64 installed, I compile 3.1.0 like this:

1. cd to the wxWidgets-3.1.0 top directory.
2. mkdir build-win, cd build-win
3. ../configure --disable-debug_flag --disable-shared --host=x86_64-w64-mingw32 --build=x86_64-linux-gnu
4. make

I use it in-place using the build-win/wx-config script.