how to cross-compile the wxWidgets in linux

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
ceejliu
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Dec 08, 2017 9:19 am

how to cross-compile the wxWidgets in linux

Post by ceejliu » Fri Dec 08, 2017 9:38 am

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.

coderrc
Earned some good credits
Earned some good credits
Posts: 141
Joined: Tue Nov 01, 2016 2:46 pm

Re: how to cross-compile the wxWidgets in linux

Post by coderrc » Fri Dec 08, 2017 1:35 pm

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.

User avatar
ggbutcher
Earned a small fee
Earned a small fee
Posts: 12
Joined: Tue Aug 08, 2017 11:37 pm

Re: how to cross-compile the wxWidgets in linux

Post by ggbutcher » Tue Dec 26, 2017 5:53 am

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.

Post Reply