QT5.1 for android compilation error.
-
Hi all,
I'm trying to build QT5 for Android according manual - http://qt-project.org/wiki/Qt5ForAndroidBuilding
Stage 6 -
make
returns error (after a few mins or work) :
cc1plus: error: unrecognized command line option ‘-mfpu=neon’
@
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_USE_BUNDLED_LIBPNG -DQT_NO_EXCEPTIONS -DQT_CORE_LIB -mfpu=neon -I../../mkspecs/linux-g++ -I. -I../../include -I../../include/QtGui -I../../include/QtGui/5.1.0 -I../../include/QtGui/5.1.0/QtGui -Iimage -I../3rdparty/libpng -I../../include/QtCore -I../../include/QtCore/5.1.0 -I../../include/QtCore/5.1.0/QtCore -I.moc/debug-shared image/qimage_neon.cpp -o .obj/debug-shared/qimage_neon.o
cc1plus: error: unrecognized command line option ‘-mfpu=neon’
@Host machine is Gentoo Linux x86
Will appreciate any advice.
-
Hi,
It seems you are using a x86 compiler. -mfpu neon concerns ARM processor. If you want to build for Android on ARM you'll need a cross-compiler
-
I use the manual - http://qt-project.org/wiki/Qt5ForAndroidBuilding
Stage 5 - is configure
@./configure -developer-build -xplatform android-g++ -nomake tests -nomake examples -android-ndk <path/to/ndk> -android-sdk <path/to/sdk> -skip qttools -skip qttranslations -skip qtwebkit -skip qtserialport -skip qtwebkit-examples-and-demos
@I provide correct paths for Android SDK & NDK.
I suppose it is compiled with right gcc version. Isn't ? -
From what I can see, it uses the linux-g++ mkspec, since you're building for android it should be the android-g++ mkspec, so there is something wrong.
Did you check that the configuration was successful ?
-
configuration looks ok, but g++ is running with linux-g++
What's wrong ?
@
Configure summaryBuilding on: linux-g++ (i386, CPU features:)
Building for: android-g++ (arm, CPU features:)Build options:
Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic concurrent cross_compile debug egl eglfs evdev eventfd freetype full-config getaddrinfo inotify ipv6ifname large-config medium-config minimal-config mremap neon no-pkg-config opengl opengles2 pcre png precompile_header private_tests qpa qpa reduce_exports reduce_relocations rpath shared small-config system-zlib v8 v8snapshot warnings_are_errors
Build parts ............ libs
Mode ................... debug
Using C++11 ............ yes
Using PCH .............. yes
Target compiler supports:
iWMMXt/Neon .......... no/yesQt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
JavaScriptCore JIT ..... no
QML debugging .......... yes
Use system proxies ..... noSupport enabled for:
Accessibility .......... yes
ALSA ................... no
CUPS ................... no
FontConfig ............. no
Iconv .................. no
ICU .................... no
Image formats:
GIF .................. plugin
JPEG ................. plugin (qt)
PNG .................. yes (qt)
Glib ................... no
GStreamer .............. no
GTK theme .............. no
Large Files ............ no
Networking:
getaddrinfo .......... yes
getifaddrs ........... no
IPv6 ifname .......... yes
OpenSSL .............. no
NIS .................... no
OpenGL ................. yes (OpenGL ES 2.x)
OpenVG ................. no
PCRE ................... yes (qt)
pkg-config ............. no
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ yes
KMS .................. no
LinuxFB .............. no
XCB .................. no
Session management ..... auto
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... plugin (qt)
TDS .................. no
udev ................... no
xkbcommon .............. no
zlib ................... yes (system)Qt is now configured for building. Just run 'gmake'.
Once everything is built, Qt is installed.
You should not run 'gmake install'.Prior to reconfiguration, make sure you remove any leftovers from
the previous build.@
-
Check your android-g++ mkspec to be sure it's correct
-
From a quick lookup in the qmake.conf in this folder, I would say that it fails to determine ANDROID_TOOLCHAIN_PREFIX, could you do a verbose configure to see if there are tests that fails ?