wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails

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.
bazza2jw
In need of some credit
In need of some credit
Posts: 1
Joined: Sat Apr 14, 2018 9:24 am

wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails

Postby bazza2jw » Sat Apr 14, 2018 9:53 am

I am trying to cross-compile wxWidgets 3.1.1 libraries for the raspberry pi.

I have the toolchain all working fine running on a Linux desktop using Qt Creator as the IDE and build system. I can build Qt using the toolchain OK.

wxWidgets builds fine on the Pi (and so when added to a sysroot), I can build wxWidgets programs for the Pi by cross compiling on the Linux desktop, using Qt Creator and qmake.

However when I use the following configure line on the desktop to cross compile :

./configure --prefix=$RPI_SYSROOT2/usr/local --host=$TARGET --with-gtk=2

where the following environmental variables haver been set:

export RPI_SYSROOT=/opt/RpiSysroot
export RPI_SYSROOT2=/opt/RpiSysroot2
export TARGET=arm-linux-gnueabihf
export TOOLCHAIN=/home/barry/x-tools/arm-rpi-linux-gnueabihf
export PATH=$TOOLCHAIN/bin:$PATH
export PREFIX=$RPI_SYSROOT2/usr/local
export PKG_CONFIG_PATH="$RPI_SYSROOT/usr/lib/pkgconfig:$RPI_SYSROOT/usr/lib/$TARGET/pkgconfig:$RPI_SYSROOT/usr/share/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="$RPI_SYSROOT"
export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1
export CPP=$TOOLCHAIN/bin/$TARGET-cpp
export CC=$TOOLCHAIN/bin/$TARGET-gcc
export CXX=$TOOLCHAIN/bin/$TARGET-g++
export INCLUDEPATH="-I$RPI_SYSROOT2/usr/include/arm-linux-gnueabihf -I$RPI_SYSROOT2/usr/include"
export CC_OPTS="-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard"
export CFLAGS="--sysroot=$RPI_SYSROOT $CC_OPTS"
export CXXFLAGS="--sysroot=$RPI_SYSROOT $CC_OPTS"
export CPPFLAGS="--sysroot=$RPI_SYSROOT"
export LD=$TOOLCHAIN/bin/$TARGET-ld
export LDFLAGS="--sysroot=$RPI_SYSROOT -L$RPI_SYSROOT2/usr/local/lib -L$RPI_SYSROOT2/lib/arm-linux-gnueabihf -L$RPI_SYSROOT2/usr/lib/arm-linux-gnueabihf -mfloat-abi=hard"
export AS=$TOOLCHAIN/bin/$TARGET-as
export STRIP=$TOOLCHAIN/bin/$TARGET-strip
export AR=$TOOLCHAIN/bin/$TARGET-ar

It fails with:
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for toolkit... gtk
checking for gcc... /home/barry/x-tools/arm-rpi-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
checking whether the C compiler works... no
configure: error: in `/Development/Libraries/wxWidgets-3.1.1':
configure: error: C compiler cannot create executables


I assume I am missing something basic. Can anyone offer suggestions?

The reason why I would like to cross compile is so wxWidgets is built with the same compiler I am using for the applications I am developing.

Bazza

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2674
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails

Postby ONEEYEMAN » Mon Apr 16, 2018 4:41 pm

Hi,
I can build wxWidgets programs for the Pi by cross compiling on the Linux desktop, using Qt Creator and qmake.


Why not use this build then?

Also, you can try to build the application anywhere you want. So you can build everything on the RPI the same way you build everything on the actual PC - there is no difference.

Thank you.

stahta01
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 233
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails

Postby stahta01 » Mon Apr 16, 2018 5:03 pm

From: http://build-gdc.readthedocs.io/en/latest/Cross-Compiler%20Basics/

I would guess instead of host you are supposed to use target; but, this is a guess on my part.

I think the first thing you have to figure out what "Compiler type" you are trying to use.

I am guessing "cross-native".

Tim S.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 8 guests