Qt5 build for Android on Ubuntu
-
Hi
trying to build Qt5 5.1 Alpha for android on ubuntu 10.04
qtbase built ok, but qtdeclarative gives the following error:make[1]: Entering directory
/home/.../development/qt5/qtdeclarative' g++ -Wl,-O1 -o qtdeclarative -L/usr/lib -lQtGui -lQtCore -lpthread /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 0 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 1 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 2 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 3 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 4 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 5 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 6 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 7 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 8 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 9 has invalid symbol index 2 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 10 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 11 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 12 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 13 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 14 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 15 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 16 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 17 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 18 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 19 has invalid symbol index 13 /usr/bin/ld: /usr/lib/debug/usr/lib/crt1.o(.debug_info): relocation 20 has invalid symbol index 20 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crt1.o: In function
_start':
(.text+0x20): undefined reference tomain' collect2: ld returned 1 exit status make[1]: *** [qtdeclarative] Error 1 make[1]: Leaving directory
/home/.../development/qt5/qtdeclarative'I can guess that using PC's libs for linking android's .so is wrong
Probably, the problem is that there is an old x86 qmake in the path which is produced such makefilethe question is how to build qt5 for android using just built qmake from qt5?
-
Solved
found another issue:
in file
qtmultimedia/src/plugins/android/jar/jar.pro
hardcoded:
API_VERSION = android-11 -
Now got:
../3rdparty/clucene/src/CLucene/document/DateField.cpp: In static member function 'static int64_t lucene::document::DateField::stringToTime(const wchar_t*)':
../3rdparty/clucene/src/CLucene/document/DateField.cpp:57:33: error: 'wcstoll' was not declared in this scope -
That looks a lot like your linker trying to pull in files from your host system. You will need to double-check your development environment.
-
Now the problem with wcstoll(). there is no such function in android afaik
-
As I said before: Check your setup.
This looks like you ended up using a cross compiler with the host libraries/headers. Check and make sure you have a the NDK installed and that the sysroot is available and actually used during the build.
-
Hi!!
vladstelmahovsky:
Got the same problem with wcstoll solved editing qttools/src/assistant/3rdparty/clucene/src/CLucene/config/repl_tchar.h
on line 54 I just removed an L from wcstoll to wcstol
This is related to long long int support...After that I had problems with wctomb undeclared in repl_tprintf.cpp at line 103 solved commenting lines 98 to 109 just for testing purposes
I believe this problem is related to _UCS2and after that:
centralwidget.cpp: In member function 'void CentralWidget::print()':
centralwidget.cpp:406:5: error: 'QPrintDialog' was not declared in this scope
centralwidget.cpp:406:18: error: expected ';' before 'dlg'
centralwidget.cpp:409:9: error: 'dlg' was not declared in this scope
centralwidget.cpp:410:5: error: 'dlg' was not declared in this scope
centralwidget.cpp: In member function 'void CentralWidget::pageSetup()':
centralwidget.cpp:423:5: error: 'QPageSetupDialog' was not declared in this scope
centralwidget.cpp:423:22: error: expected ';' before 'dlg'
centralwidget.cpp:424:5: error: 'dlg' was not declared in this scope
centralwidget.cpp: In member function 'void CentralWidget::printPreview()':
centralwidget.cpp:433:5: error: 'QPrintPreviewDialog' was not declared in this scope
centralwidget.cpp:433:25: error: expected ';' before 'preview'
centralwidget.cpp:434:14: error: 'preview' was not declared in this scope
make[4]: *** [.obj/debug-shared/centralwidget.o] Error 1
make[3]: *** [sub-assistant-make_first-ordered] Error 2
make[2]: *** [sub-assistant-make_first-ordered] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qttools-make_first] Error 2// ------------------------------------------------------------------------------------------------- =)
anyone can help?? thanks!!
My specs:
Running on Mac OSX 10.8.3
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)clang:
Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.3.0My ./configure and result:
./configure -opensource -confirm-license -xplatform android-g++ -android-ndk /Developer/android-ndk-r8e -android-sdk /Developer/adt-bundle-mac-x86_64-20130219/sdk -nomake tests -nomake examples -android-ndk-host darwin-x86_64Running configuration tests...
QMAKE_MAC_SDK must be set when building on MacBuilding on: macx-clang
Building for: android-g++
Architecture: arm, features:
Host architecture: x86_64, features: mmx sse sse2 sse3 ssse3Build .................. libs
Configuration .......... cross_compile qpa precompile_header neon pcre minimal-config small-config medium-config large-config full-config build_all debug_and_release no-pkg-config evdev accessibility egl eglfs opengl opengles2 shared qpa reduce_exports reduce_relocations clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname inotify eventfd png freetype system-zlib concurrent audio-backend v8 release debug qt_framework
Debug .................. yes (combined)
Default Link ........... debug
Force debug info ....... no
C++11 support .......... no
pkg-config ............. no
Qt D-Bus module ........ no
Qt Concurrent code ..... yes
Qt GUI module .......... yes
Qt Widgets module ...... yes
JavaScriptCore JIT ..... no
QML debugging .......... yes
PCH support ............ yes
iWMMXt support ......... no
NEON support ........... yes
IPv6 ifname support .... yes
getaddrinfo support .... yes
getifaddrs support ..... no
Accessibility .......... yes
NIS support ............ no
CUPS support ........... no
Iconv support .......... no
Glib support ........... no
GStreamer support ...... no
PulseAudio support ..... no
Large File support ..... no
GIF support ............ plugin
JPEG support ........... plugin (qt)
PNG support ............ yes (qt)
zlib support ........... system
Session management ..... auto
libudev support ........ no
Use system proxies ..... no
OpenGL support ......... yes (OpenGL ES 2.x)
OpenVG support ......... no
XShape support ......... auto
XVideo support ......... auto
XSync support .......... auto
Xinerama support ....... runtime
Xcursor support ........ runtime
Xfixes support ......... runtime
Xrandr support ......... runtime
Xi support ............. runtime
Xi2 support ............ auto
MIT-SHM support ........ auto
FontConfig support ..... no
XKB support ............ auto
GTK theme support ...... no
SQLite support ......... plugin (qt)
OpenSSL support ........ no
Alsa support ........... no
CoreWlan support ....... no
libICU support ......... no
PCRE support ........... qt
Xcb support ............ no
Xrender support ........ no
EGLFS support .......... yes
DirectFB support ....... no
LinuxFB support ........ no
KMS support ............ no -
as far as I understood, qttools should be built for host architecture