Configuring Qt Creator for the Raspberry Pi on OS X
-
I'm trying to setup Qt Creator on OS X based on the instructions here: http://www.ics.com/blog/configuring-qt-creator-raspberry-pi
Everything works fine until I get to step 4. When I execute ./configure I get a message that C++11 is disabled. I've searched to try and either enable or install C++11 on OS X, but haven't found anything helpful. I'm running OS X 10.11.6
Has anyone had luck with this?
Here is the output I get:
- cd qtbase
- /Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/configure -top-level -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /Users/jasonstockton/raspi/sysroot -opensource -confirm-license -prefix /usr/local/qt5pi -extprefix /Users/jasonstockton/raspi/qt5pi -hostprefix /Users/jasonstockton/raspi/qt5 -v
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 2.You have already accepted the terms of the Open Source license.
/Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/configure: line 3494: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
DEFAULT_INCDIRS="/usr/include
/usr/local/include"
DEFAULT_LIBDIRS="/lib
/usr/lib"
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Found pkg-config from $PATH: /usr/local/bin/pkg-config
Note: PKG_CONFIG_LIBDIR automatically set to /Users/jasonstockton/raspi/sysroot/usr/lib/pkgconfig:/Users/jasonstockton/raspi/sysroot/usr/share/pkgconfig
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /Users/jasonstockton/raspi/sysroot
Determining architecture... ()
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/Users/jasonstockton/raspi/sysroot -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-rasp-pi2-g++ -o arch.o arch.cpp
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
make: *** [arch.o] Error 126
Unable to determine architecture!Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.8 -Wall -W -fPIC -I. -I../../mkspecs/macx-clang -o arch.o arch.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.8 -o arch arch.o
Found architecture in binary
CFG_HOST_ARCH="x86_64"
CFG_HOST_CPUFEATURES=" cx16 mmx sse sse2 sse3 ssse3"
System architecture: 'unknown'
Host architecture: 'x86_64'
Precompiled-headers support disabled.
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
/Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/fvisibility.test: line 29: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
Symbol visibility control disabled.
/Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/configure: line 366: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
/Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/configure: line 366: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ --sysroot=/Users/jasonstockton/raspi/sysroot -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
/Users/jasonstockton/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/bsymbolic_functions.test: line 18: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
Symbolic function binding disabled.
checking for C++11...
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/Users/jasonstockton/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o c++11.o c++11.cpp
/Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: /Users/jasonstockton/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
make: *** [c++11.o] Error 126
C++11 disabled.
ERROR: Qt requires a C++11 compiler and yours does not seem to be that.
Please upgrade. -
Hi,
From the error output you are likely trying to run the Linux binary of the cross-compiler which is not possible on OS X.
-
Thanks for the tip. Based on what you said I was able to find a post in these forums that references http://www.jaredwolff.com/blog/cross-compiling-on-mac-osx-for-raspberry-pi/ (I think you posed it). I've tried countless times to get this to work and am not having luck. I went through everything and when doing ct-ng build I got a ton of warnings relating to all sorts of things. While the build was running I see that Jared shared a link to the compiled binaries so I downloaded them. The next step is to test everything that was done. I finally failed when running /Volumes/RBPi/arm-unknown-linux-gnueabi-gcc -o test test.c For the life of me I can't find arm-unknown-linux-gnueabi-gcc.
I should be asking Jared about this, but thought I would tell you about my experiences just in case you had a thought on what is going on or if you know of any other tutorials to make this work.
I understand the benefit of cross-compiling, but I'm wondering whether or not it's worth trying to get this to work. It seems that others have said it's rather difficult to get cross-compiling setup. Based on the design of my application that I have in my head I don't think it's a large one so compiling on the RasberryPi might not be that big of a deal, maybe. Based on your experience, what are your thoughts on setting up cross-compiling vs compiling on the RasberryPi?
-
Depending on your RPI version, it can take a long time to compile natively especially Qt which is big.
Personally, if I need to cross-compile something, I setup a virtual machine with Linux on it. It takes less time to get the setup to work.
However, I'd be happy if you find a working solution for OS X.
-
I'm trying the virtual machine route, but am running into the same issue with the error regarding the C++11 compiler" ERROR: Qt requires a C++11 compiler and yours does not seem to be that.
Is there a specific version of Linux that I should be using? I am trying the latest version of Ubuntu.
Here is the output again:
cd qtbase- /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure -top-level -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=/home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /home/jason/raspi/sysroot -opensource -confirm-license -prefix /usr/local/qt5pi -extprefix /home/jason/raspi/qt5pi -hostprefix /home/jason/raspi/qt5 -v
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.
You are also licensed to use this software under the terms of
the GNU General Public License (GPL) versions 2.You have already accepted the terms of the Open Source license.
/home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: 3494: /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
DEFAULT_INCDIRS="/usr/include
/usr/local/include"
DEFAULT_LIBDIRS="/lib
/usr/lib"
Creating qmake...
make: Nothing to be done for 'first'.
Running configuration tests...
Found pkg-config from $PATH: /usr/bin/pkg-config
Note: PKG_CONFIG_LIBDIR automatically set to /home/jason/raspi/sysroot/usr/lib/pkgconfig:/home/jason/raspi/sysroot/usr/share/pkgconfig
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/jason/raspi/sysroot
Determining architecture... ()
/home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/jason/raspi/sysroot -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-rasp-pi2-g++ -o arch.o arch.cpp
make: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: Command not found
Makefile:196: recipe for target 'arch.o' failed
make: *** [arch.o] Error 127
Unable to determine architecture!Could not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp
g++ -o arch arch.o
Found architecture in binary
CFG_HOST_ARCH="x86_64"
CFG_HOST_CPUFEATURES=" mmx sse sse2"
System architecture: 'unknown'
Host architecture: 'x86_64'
Precompiled-headers support disabled.
/home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
/home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/fvisibility.test: 29: /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/fvisibility.test: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
Symbol visibility control disabled.
/home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: 366: /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
/home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: 366: /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/configure: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
/home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ --sysroot=/home/jason/raspi/sysroot -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
/home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/bsymbolic_functions.test: 18: /home/jason/raspi/qt-everywhere-opensource-src-5.7.0/qtbase/config.tests/unix/bsymbolic_functions.test: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
Symbolic function binding disabled.
checking for C++11...
/home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -marm -mthumb-interwork -mfpu=neon-vfpv4 -mtune=cortex-a7 -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/home/jason/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I../../../mkspecs/devices/linux-rasp-pi2-g++ -o c++11.o c++11.cpp
make: /home/jason/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: Command not found
Makefile:195: recipe for target 'c++11.o' failed
make: *** [c++11.o] Error 127
C++11 disabled.
ERROR: Qt requires a C++11 compiler and yours does not seem to be that.
Please upgrade. -
Then install the cross-compiler provided by Ubuntu, it should be recent enough.
-
I figured out what my issue was on Ubuntu. My Ubuntu VM is 64 bit so the 32 bit compiler wasn't working. I found the 64 bit version and was able to get past my error on Ubuntu. I need to use the 64 bit compiler, but build it for the 32 bit Raspberry or build a 32 bit VM.
I think part of my issues stem from the fact that I don't really know what's going on with all the components need. I'm learning this as a go. I've read high level descriptions of what each is, but I need to understand them in detail and how they relate to the overall development process.
Thanks for your help
-
The fact that the compiler itself is 64bit doesn't mean it can't output 32bit code.
-
True, I did see that is possible; however that's one of the areas where I'm struggling with Linux development. Among other things I need to understand more about when to use what library. Different sources all seem to have different versions of libraries to use. How do you know what library and version to use for your particular installation?
-
Because it depends on what your target is and what you run on your target.
You could also be using something like the Yocto project where you cross-compile your whole system (including Qt).