therecipe / qt

Qt binding for Go (Golang) with support for Windows / macOS / Linux / FreeBSD / Android / iOS / Sailfish OS / Raspberry Pi / AsteroidOS / Ubuntu Touch / JavaScript / WebAssembly
GNU Lesser General Public License v3.0
10.44k stars 744 forks source link

qtsetup full android failed #689

Open F0rth opened 6 years ago

F0rth commented 6 years ago

Hi,

I followed the instructions and installed:

so there is no "include" directory in "android-ndk-r17b/platforms/android-16/arch-arm/usr/" I symlinked it: ls /tmp/android-ndk-r17b/platforms/android-16/arch-arm/usr/ total 0 drwxrwxr-x 3 forth forth 80 19 août 03:13 . drwxrwxr-x 3 forth forth 60 7 juin 16:04 .. lrwxrwxrwx 1 forth forth 31 19 août 03:13 include -> ../../../../sysroot/usr/include drwxrwxr-x 2 forth forth 520 7 juin 16:12 lib

there is no "asm" either, tried another symlink:

[forth@mjolnir usr]$ ls -alh include/asm lrwxrwxrwx 1 forth forth 25 19 août 03:21 include/asm -> aarch64-linux-android/asm

and now got this error: `` INFO[0000] running: 'qtsetup test android' [docker=false] [vagrant=false] INFO[0000] testing qml/application
ERRO[0014] failed to run command cmd="go build -p 4 -v -ldflags=all=\"-s\" \"-w\" -o /home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application/deploy/android/libgo_base.so -tags=\"android\" \"minimal\" -pkgdir /home/forth/go/pkg/android_android_arm -buildmode c-shared" dir=/home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application env="CXX=/tmp/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ CGO_LDFLAGS=--sysroot=/tmp/android-ndk-r17b/platforms/android-16/arch-arm -llog CGO_LDFLAGS_ALLOW=. CGO_ENABLED=1 CGO_CPPFLAGS=-isystem /tmp/android-ndk-r17b/platforms/android-16/arch-arm/usr/include CGO_CXXFLAGS_ALLOW=. PATH=/home/forth/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/forth/go/bin:/home/forth/AE/VSCode-linux-x64:/home/forth/bin:/usr/lib/go-1.8/bin:/opt/go/bin:/home/forth/.local/bin:/home/forth/lgo/bin GOPATH=/home/forth/go GOROOT=/usr/lib/go GOARM=7 GOARCH=arm CC=/tmp/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc CGO_CFLAGS_ALLOW=.* GOOS=android" error="exit status 2" func=RunCmd name="build for android on linux" errors runtime/internal/sys internal/race sync/atomic unicode/utf8 unicode runtime/internal/atomic internal/testlog math runtime/cgo runtime

runtime/cgo

In file included from /tmp/android-ndk-r17b/sysroot/usr/include/signal.h:35:0, from /tmp/android-ndk-r17b/sysroot/usr/include/sys/select.h:36, from /tmp/android-ndk-r17b/sysroot/usr/include/sys/time.h:37, from /tmp/android-ndk-r17b/sysroot/usr/include/time.h:33, from /tmp/android-ndk-r17b/sysroot/usr/include/pthread.h:37, from gcc_android_arm.c:5: /tmp/android-ndk-r17b/platforms/android-16/arch-arm/usr/include/asm/sigcontext.h:40:3: error: unknown type name '__uint128_t' __uint128_t vregs[32]; ^ strconv sync io reflect syscall bytes strings bufio time internal/poll os fmt log ``

(I wish I could use docker, but got another error about openssl so I tried this way)

F0rth commented 6 years ago

so, I tried [forth@mjolnir include]$ ls asm lrwxrwxrwx 1 forth forth 25 19 août 03:54 asm -> arm-linux-androideabi/asm and got:

`` INFO[0000] running: 'qtsetup test android' [docker=false] [vagrant=false] INFO[0000] testing qml/application
ERRO[0013] failed to run command cmd="go build -p 4 -v -ldflags=all=\"-s\" \"-w\" -o /home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application/deploy/android/libgo_base.so -tags=\"android\" \"minimal\" -pkgdir /home/forth/go/pkg/android_android_arm -buildmode c-shared" dir=/home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application env="GOARCH=arm CC=/tmp/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc CGO_LDFLAGS_ALLOW=. GOARM=7 PATH=/home/forth/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/forth/go/bin:/home/forth/AE/VSCode-linux-x64:/home/forth/bin:/usr/lib/go-1.8/bin:/opt/go/bin:/home/forth/.local/bin:/home/forth/lgo/bin GOROOT=/usr/lib/go CGO_CFLAGS_ALLOW=. CGO_CXXFLAGS_ALLOW=.* GOPATH=/home/forth/go CXX=/tmp/android-ndk-r17b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ CGO_CPPFLAGS=-isystem /tmp/android-ndk-r17b/platforms/android-16/arch-arm/usr/include GOOS=android CGO_ENABLED=1 CGO_LDFLAGS=--sysroot=/tmp/android-ndk-r17b/platforms/android-16/arch-arm -llog" error="exit status 2" func=RunCmd name="build for android on linux" errors internal/race runtime/internal/sys unicode unicode/utf8 sync/atomic runtime/internal/atomic math internal/testlog runtime runtime/cgo strconv

runtime/cgo

gcc_android.c:30: error: undefined reference to 'stderr' gcc_libinit.c:30: error: undefined reference to 'stderr' gcc_linux_arm.c:25: error: undefined reference to 'sigfillset' gcc_util.c:19: error: undefined reference to 'stderr' collect2: error: ld returned 1 exit status sync io reflect syscall bytes strings bufio time internal/poll os fmt log ``

F0rth commented 6 years ago

ld -v GNU ld (GNU Binutils) 2.31.1

therecipe commented 6 years ago

Hey

Sorry, seems like I broke the android image 2 weeks ago while cleaning up the code. But the image should work now again with: https://github.com/therecipe/qt/commit/d0f30a6e4c39e0989b1b00169b66abbca442becf However, it will take approx. 24 hours before it's being build because there is currently a very long list of images queued up to be build.

If you don't want to wait, then you can also build the image yourself. But you will also need to build the latest linux image first.

To do so, just update the binding and run:

cd $GOPATH/src/github.com/therecipe/qt/internal/docker/linux && docker build -t therecipe/qt:linux . && cd $GOPATH/src/github.com/therecipe/qt/internal/docker/android && docker build -t therecipe/qt:android .

If you however want to use your local android setup, then you might need to update the binding as well and check if you installed the android-sdk build-tools 28.0.2 and the platform-sdk 28 (build-tools 26.0.0 and platform-sdk 26, if you don't want to update the binding)

But whether or not you update the binding, you will need to install the old android-ndk r14b from here: https://developer.android.com/ndk/downloads/older_releases

It seems like android-ndk versions newer than 14 might not be supported until Qt 5.12, but I will take a look.

And sorry, the documentation is a bit dated and I will probably need to update the links or clarify which dependency versions are currently supported/needed for this to work.

Also, btw you will need to run the setup again (desktop and android) after updating the binding.

F0rth commented 6 years ago

thank you for your detailed anwsers. I followed your instructions (updated build-tools 28.0.2 and platform-sdk 28, ndk 14, git pull, regenerate linux and android target) and got those errors:

`` qtsetup test android INFO[0000] running: 'qtsetup test android' [docker=false] [vagrant=false] INFO[0000] testing qml/application
ERRO[0013] failed to run command cmd="go build -p 4 -v -ldflags=all=\"-s\" \"-w\" -o /home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application/deploy/android/libgo_base.so -tags=\"android\" \"minimal\" -pkgdir /home/forth/go/pkg/android_android_arm -buildmode c-shared" dir=/home/forth/go/src/github.com/therecipe/qt/internal/examples/qml/application env="GOOS=android GOROOT=/usr/lib/go CGO_CFLAGS_ALLOW=. CGO_CXXFLAGS_ALLOW=. GOARM=7 CC=/tmp/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc CXX=/tmp/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ CGO_CPPFLAGS=-isystem /tmp/android-ndk-r14b/platforms/android-16/arch-arm/usr/include CGO_LDFLAGS_ALLOW=.* CGO_LDFLAGS=--sysroot=/tmp/android-ndk-r14b/platforms/android-16/arch-arm -llog GOARCH=arm CGO_ENABLED=1 PATH=/home/forth/perl5/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/forth/go/bin:/home/forth/AE/VSCode-linux-x64:/home/forth/bin:/usr/lib/go-1.8/bin:/opt/go/bin:/home/forth/.local/bin:/home/forth/lgo/bin GOPATH=/home/forth/go" error="exit status 2" func=RunCmd name="build for android on linux" errors internal/race runtime/internal/sys sync/atomic unicode unicode/utf8 runtime/internal/atomic math internal/testlog runtime runtime/cgo strconv sync io reflect syscall bytes strings bufio time internal/poll os fmt log github.com/therecipe/qt github.com/therecipe/qt/core

github.com/therecipe/qt/core

In file included from /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include/type_traits:35:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:45, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

error This file requires compiler and library support for the \

^ In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:105:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /opt/Qt/5.11.1/android_armv7/include/QtCore/qcompilerdetection.h:561:6: error: #error Qt requires a C++11 compiler and yours does not seem to be that.

error Qt requires a C++11 compiler and yours does not seem to be that.

  ^

In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1162:1: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat] Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char varName, bool ok=nullptr) Q_DECL_NOEXCEPT; ^ In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:46:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1200, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /opt/Qt/5.11.1/android_armv7/include/QtCore/qbasicatomic.h:61:4: error: #error "Qt requires C++11 support"

error "Qt requires C++11 support"

^

In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qobjectdefs.h:50:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qobject.h:46, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qcoreapplication.h:46, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QCoreApplication:1, from core-minimal.cpp:11: /opt/Qt/5.11.1/android_armv7/include/QtCore/qobjectdefs_impl.h:337:9: warning: identifier 'decltype' is a keyword in C++11 [-Wc++0x-compat] template static auto test(F f) -> decltype(((f.operator()((dummy())...)), int())); ^ In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:505:7: error: expected nested-name-specifier before 'qsizetype' using qsizetype = QIntegerForSizeof::Signed; ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:963:32: error: 'add_const' in namespace 'std' does not name a template type Q_DECL_CONSTEXPR typename std::add_const::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:963:41: error: expected unqualified-id before '<' token Q_DECL_CONSTEXPR typename std::add_const::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:966:23: error: expected ',' or '...' before '&&' token void qAsConst(const T &&) Q_DECL_EQ_DELETE; ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:977:25: error: expected ',' or '...' before '&&' token QForeachContainer(T &&t) : c(std::move(t)), i(qAsConst(c).begin()), e(qAsConst(c).end()) {} ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:979:41: error: expected ',' or '...' before '&&' token QForeachContainer(QForeachContainer &&other) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:979:48: error: invalid constructor; you probably meant 'QtPrivate::QForeachContainer (const QtPrivate::QForeachContainer&)' QForeachContainer(QForeachContainer &&other) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:987:52: error: expected ',' or '...' before '&&' token QForeachContainer &operator=(QForeachContainer &&other) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:998:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 int control = 1; ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h: In constructor 'QtPrivate::QForeachContainer::QForeachContainer(T)': /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:977:34: error: 'move' is not a member of 'std' QForeachContainer(T &&t) : c(std::move(t)), i(qAsConst(c).begin()), e(qAsConst(c).end()) {} ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:977:44: error: 't' was not declared in this scope QForeachContainer(T &&t) : c(std::move(t)), i(qAsConst(c).begin()), e(qAsConst(c).end()) {} ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h: In member function 'QtPrivate::QForeachContainer& QtPrivate::QForeachContainer::operator=(QtPrivate::QForeachContainer)': /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:989:13: error: 'move' is not a member of 'std' c = std::move(other.c); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:989:23: error: 'other' was not declared in this scope c = std::move(other.c); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:992:19: error: 'move' is not a member of 'std' control = std::move(other.control); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h: At global scope: /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:33: error: 'decay' in namespace 'std' does not name a template type QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:38: error: expected template-argument before '<' token QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:38: error: expected '>' before '<' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:47: error: template argument 1 is invalid QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:49: error: expected '::' before 'qMakeForeachContainer' QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:73: error: expected ',' or '...' before '&&' token QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1002:76: error: ISO C++ forbids declaration of 'qMakeForeachContainer' with no type [-fpermissive] QForeachContainer<typename std::decay::type> qMakeForeachContainer(T &&t) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h: In function 'int QtPrivate::qMakeForeachContainer(T)': /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:44: error: 'decay' in namespace 'std' does not name a template type return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:49: error: expected template-argument before '<' token return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:49: error: expected '>' before '<' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:58: error: template argument 1 is invalid return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:59: error: expected '::' before '(' token return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:59: error: expected identifier before '(' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:60: error: 'forward' is not a member of 'std' return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:74: error: expected primary-expression before '>' token return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1004:76: error: 't' was not declared in this scope return QForeachContainer<typename std::decay::type>(std::forward(t)); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h: At global scope: /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1162:79: error: 'nullptr' was not declared in this scope Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char varName, bool ok=nullptr) Q_DECL_NOEXCEPT; ^ In file included from /opt/Qt/5.11.1/android_armv7/include/QtCore/qglobal.h:1194:0, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qatomic.h:41, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qrefcount.h:43, from /opt/Qt/5.11.1/android_armv7/include/QtCore/qbytearray.h:44, from /opt/Qt/5.11.1/android_armv7/include/QtCore/QByteArray:1, from core-minimal.cpp:9: /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:61:25: error: 'is_enum' is not a member of 'std' isSpecialized = std::is_enum::value, // don't require every enum to be marked manually ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:61:39: error: expected primary-expression before '>' token isSpecialized = std::is_enum::value, // don't require every enum to be marked manually ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:61:40: error: '::value' has not been declared isSpecialized = std::is_enum::value, // don't require every enum to be marked manually ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:63:22: error: 'is_integral' is not a member of 'std' isIntegral = std::is_integral::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:63:40: error: expected primary-expression before '>' token isIntegral = std::is_integral::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:63:41: error: '::value' has not been declared isIntegral = std::is_integral::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:64:37: error: 'is_enum' is not a member of 'std' isComplex = !isIntegral && !std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:64:51: error: expected primary-expression before '>' token isComplex = !isIntegral && !std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:64:52: error: '::value' has not been declared isComplex = !isIntegral && !std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:66:25: error: 'is_enum' is not a member of 'std' isRelocatable = std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:66:39: error: expected primary-expression before '>' token isRelocatable = std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:66:40: error: '::value' has not been declared isRelocatable = std::is_enum::value, ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:40: error: 'enable_if' in namespace 'std' does not name a template type struct QTypeInfoQuery<T, typename std::enable_if<QTypeInfo::isRelocatable || true>::type> : public QTypeInfo ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:49: error: expected template-argument before '<' token struct QTypeInfoQuery<T, typename std::enable_if<QTypeInfo::isRelocatable || true>::type> : public QTypeInfo ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:49: error: expected '>' before '<' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:92: error: template argument 2 is invalid struct QTypeInfoQuery<T, typename std::enable_if<QTypeInfo::isRelocatable || true>::type> : public QTypeInfo ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:94: error: expected '::' before ':' token struct QTypeInfoQuery<T, typename std::enable_if<QTypeInfo::isRelocatable || true>::type> : public QTypeInfo ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:94: error: expected identifier before ':' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:94: error: qualified name does not name a class before ':' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:94: error: expected '{' before ':' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:130:94: error: expected unqualified-id before ':' token /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:22: error: 'is_integral' is not a member of 'std' isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:270:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(QFlags, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:45: error: expected primary-expression before '>' token isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:270:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(QFlags, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:46: error: '::value' has not been declared isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:270:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(QFlags, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:22: error: 'is_integral' is not a member of 'std' isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:265:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:20: error: expected primary-expression before 'bool' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:40: note: in definition of macro 'Q_DECLARE_TYPEINFO_BODY' isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:20: error: expected '}' before 'bool' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:40: note: in definition of macro 'Q_DECLARE_TYPEINFO_BODY' isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:256:45: error: expected unqualified-id before '>' token isIntegral = std::is_integral< TYPE >::value, \ ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:265:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:261:1: error: expected declaration before '}' token } ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:265:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO_BODY' Q_DECLARE_TYPEINFO_BODY(TYPE, FLAGS) ^ /opt/Qt/5.11.1/android_armv7/include/QtCore/qtypeinfo.h:300:1: note: in expansion of macro 'Q_DECLARE_TYPEINFO' Q_DECLARE_TYPEINFO(bool, Q_PRIMITIVE_TYPE); ^

``

therecipe commented 6 years ago

Mh, I'm not quite sure what is causing this.

Could you try to remove /home/forth/go/pkg/android_android_arm (maybe also /opt/go/pkg/android_android_arm), then export a minimal PATH like:

/usr/local/bin:/usr/bin:/bin:/opt/go/bin

and then run qtsetup full android again.

Also maybe post the content of $GOPATH/src/github.com/therecipe/qt/core/minimal_cgo_android_linux_arm.go so I can look into this.

edit: also do you have ANDROID_NDK exported by any chance? (It shouldn't be required but it also shouldn't cause trouble, just want to rule this out)

F0rth commented 6 years ago

cat $GOPATH/src/github.com/therecipe/qt/core/minimal_cgo_android_linux_arm.go // +build android,minimal

package core

/*

cgo CFLAGS: -D__ANDROID_API__=16 --sysroot=/tmp/android-ndk-r14b/sysroot -isystem /tmp/android-ndk-r14b/sysroot/usr/include/arm-linux-androideabi -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -mthumb -Os -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB

cgo CXXFLAGS: -D__ANDROID_API__=16 --sysroot=/tmp/android-ndk-r14b/sysroot -isystem /tmp/android-ndk-r14b/sysroot/usr/include/arm-linux-androideabi -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -mthumb -Os -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB

cgo CXXFLAGS: -I../../qt -I. -I/opt/Qt/5.11.1/android_armv7/include -I/opt/Qt/5.11.1/android_armv7/include/QtSvg -I/opt/Qt/5.11.1/android_armv7/include/QtWidgets -I/opt/Qt/5.11.1/android_armv7/include/QtGui -I/opt/Qt/5.11.1/android_armv7/include/QtCore -I. -I/opt/Qt/5.11.1/android_armv7/mkspecs/android-g++

cgo LDFLAGS: --sysroot=/tmp/android-ndk-r14b/platforms/android-16/arch-arm/ -Wl,-rpath=/opt/Qt/5.11.1/android_armv7/lib -Wl,--no-undefined -Wl,-z,noexecstack

cgo LDFLAGS: -L/tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/tmp/android-ndk-r14b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -L/opt/Qt/5.11.1/android_armv7/lib -lQt5Svg -L/opt/android/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a -L/opt/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9 -lQt5Widgets -lQt5Gui -lQt5Core -lGLESv2 -lgnustl_shared -lgcc -llog -lz -lm -ldl -lc

cgo LDFLAGS: -Wl,--allow-shlib-undefined

cgo CFLAGS: -Wno-unused-parameter -Wno-unused-variable -Wno-return-type

cgo CXXFLAGS: -Wno-unused-parameter -Wno-unused-variable -Wno-return-type

*/ import "C"

env |grep NDK ANDROID_NDK_DIR=/tmp/android-ndk-r14b

F0rth commented 6 years ago

I neither have /home/forth/go/pkg/android_android_arm nor /opt/go/pkg/android_android_arm but ls $GOPATH/pkg/gomobile/ total 36K drwxr-xr-x 8 forth forth 4,0K 13 août 2016 . drwxr-xr-x 5 forth forth 4,0K 5 avril 2017 .. drwxr-xr-x 8 forth forth 4,0K 13 août 2016 android-ndk-r12b drwxr-xr-x 2 forth forth 4,0K 12 août 2016 dl drwxr-xr-x 28 forth forth 4,0K 13 août 2016 pkg_android_386 drwxr-xr-x 28 forth forth 4,0K 13 août 2016 pkg_android_amd64 drwxr-xr-x 28 forth forth 4,0K 13 août 2016 pkg_android_arm drwxr-xr-x 28 forth forth 4,0K 13 août 2016 pkg_android_arm64 -rw-r--r-- 1 forth forth 31 13 août 2016 version

is it related ?

F0rth commented 6 years ago

I delete this directory, cleaned the PATH env, but got the same error about c++11 /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

therecipe commented 6 years ago

is it related ?

Mh, these are gomobile packages so it's probably not related

Could you show me the output from qtsetup check android ?

F0rth commented 6 years ago

INFO[0000] running: 'qtsetup check android' [docker=false] [vagrant=false] INFO[0000] GOOS: 'linux'
INFO[0000] GOARCH: 'amd64'
INFO[0000] GOVERSION: 'go1.10.3'
INFO[0000] GOROOT: '/usr/lib/go'
INFO[0000] GOPATH: '/home/forth/go' INFO[0000] GOBIN: '/home/forth/go/bin' INFO[0000] QT_HASH: 'd0f30a6e4c39e0989b1b00169b66abbca442becf' INFO[0000] QT_VERSION: '5.11.1'
INFO[0000] QT_VERSION_MAJOR: '5.11.1'
INFO[0000] QT_DIR: '/opt/Qt'
INFO[0000] QT_STUB: 'false'
INFO[0000] QT_DEBUG: 'false'
INFO[0000] QT_QMAKE_DIR: ''
INFO[0000] QT_WEBKIT: 'false'
INFO[0000] JDK_DIR:
'/opt/jdk/jdk1.8.0_181' INFO[0000] ANDROID_SDK_DIR: '/opt/android'
INFO[0000] ANDROID_NDK_DIR:
'/tmp/android-ndk-r14b'

therecipe commented 6 years ago

Thanks

Okay, seems like your cgo* files are missing the -std=gnu++11 flag inside the CXXFLAGS exactly like the error suggests ... strange I'm not sure how this could have happened

Did you use the official Qt installer?

edit: also could you check if env | grep QMAKE prints anything?

F0rth commented 6 years ago

I have no QMAKE env var. I use the official Qt installer.

F0rth commented 6 years ago

is it still relevant to go down the rabbit hole ? May it help you to understand this bug ? otherwise this issue can be closed :-)

therecipe commented 6 years ago

Sorry for the delay.

Depends on you, I'm pretty sure that it's not a bug in qtdeploy since the cgo_* files are all generated by parsing the Makefiles created by qmake. I could work around this by forcing the inclusion of -std=gnu++11 but that would just be a dirty fix.

I hoped that you might have some QMAKE_* env vars set or something ...

But what you could try would be to create an empty test.pro file, then export ANDROID_NDK_ROOT to point to the NDK, then run $QT_DIR/5.11.1/android_armv7/bin/qmake /path/to/test.pro and check whether or not the generated Makefile has the -std=gnu++11 flag listed for the CXXFLAGS. If it does, then it's a qtdeploy issue if not then the issue is either caused by qmake or there is something wrong with your PATH or so.

Also which distro and version are you using?

Btw, this patch should fix the issue for you but it's just an ugly workaround:

diff --git a/internal/binding/templater/template_cgo_qmake.go b/internal/binding/templater/template_cgo_qmake.go
index 8b8e5a77..ad19ac20 100644
--- a/internal/binding/templater/template_cgo_qmake.go
+++ b/internal/binding/templater/template_cgo_qmake.go
@@ -429,6 +429,7 @@ func createCgo(module, path, target string, mode int, ipkg, tags string) string
    switch target {
    case "android", "android-emulator":
        fmt.Fprint(bb, "#cgo LDFLAGS: -Wl,--allow-shlib-undefined\n")
+       fmt.Fprint(bb, "#cgo CXXFLAGS: -std=gnu++11\n")
    case "windows":
        fmt.Fprint(bb, "#cgo LDFLAGS: -Wl,--allow-multiple-definition\n")
    case "ios":
F0rth commented 6 years ago

CXXFLAGS = -D__ANDROID_API__=16 --sysroot=/tmp/android-ndk-r14b/sysroot -isystem /tmp/android-ndk-r14b/sysroot/usr/include/arm-linux-androideabi -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /tmp/android-ndk-r14b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -fstack-protector-strong -DANDROID -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fno-builtin-memmove -mthumb -Os -Wall -W -D_REENTRANT -fPIC $(DEFINES) I'm using archlinux.

therecipe commented 6 years ago

Thanks, so it's a qmake issue ... I will try to reproduce it on a fresh VM and also dig through the qmake source, maybe I'm lucky