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
wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails
Re: wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails
Hi,
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.
Why not use this build then?I can build wxWidgets programs for the Pi by cross compiling on the Linux desktop, using Qt Creator and qmake.
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.
Re: wxWidgets 3.1.1 Cross Compile For Arm - Configure Fails
From: http://build-gdc.readthedocs.io/en/late ... %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.
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.