go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Crosscompilation for android/arm fails #113

Closed GeertJohan closed 9 years ago

GeertJohan commented 9 years ago

I'm trying to compile go-qml for android/arm. This could be simple build configuration that I'm doing wrong...

Build config:

GOOS=android GOARCH=arm GOARM=7 \
CGO_ENABLED=1 \
CC=$NDK_CC CXX=$NDK_CXX \
go build -v -x

Error (full log: http://pastebin.com/XxVnwq0F):

/home/geertjohan/Applications/android-ndk-toolchain/bin/arm-linux-androideabi-g++ -I . -fPIC -marm -pthread -fmessage-length=0 -I./cpp -I/usr/include/qt5/QtCore -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtNetwork -I $WORK/gopkg.in/qml.v1/_obj/ -g -O2 -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing -o $WORK/gopkg.in/qml.v1/_obj/all.cpp.o -c ./all.cpp
# gopkg.in/qml.v1
In file included from /usr/include/qt5/QtQuick/qquickwindow.h:47:0,
                 from /usr/include/qt5/QtQuick/qquickview.h:45,
                 from /usr/include/qt5/QtQuick/QQuickView:1,
                 from ../../../gopath/src/gopkg.in/qml.v1/cpp/capi.cpp:2,
                 from ../../../gopath/src/gopkg.in/qml.v1/all.cpp:2:
/usr/include/qt5/QtGui/qopengl.h:110:21: fatal error: GL/gl.h: No such file or directory

When I set CPLUS_INCLUDE_PATH="/usr/include" build fails with (full log: http://pastebin.com/4LWzddUD):

/home/geertjohan/Applications/android-ndk-toolchain/bin/arm-linux-androideabi-g++ -I . -fPIC -marm -pthread -fmessage-length=0 -I./cpp -I/usr/include/qt5/QtCore -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtQuick -I/usr/include/qt5/QtQml -I/usr/include/qt5/QtNetwork -I $WORK/gopkg.in/qml.v1/_obj/ -g -O2 -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing -o $WORK/gopkg.in/qml.v1/_obj/all.cpp.o -c ./all.cpp
# gopkg.in/qml.v1
In file included from /home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/bits/locale_facets.h:43:0,
                 from /home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/bits/basic_ios.h:39,
                 from /home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/ios:45,
                 from /home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/ostream:40,
                 from /home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/iterator:64,
                 from /usr/include/qt5/QtCore/qlist.h:49,
                 from /usr/include/qt5/QtCore/qobject.h:51,
                 from /usr/include/qt5/QtCore/qcoreapplication.h:48,
                 from /usr/include/qt5/QtWidgets/qapplication.h:45,
                 from /usr/include/qt5/QtWidgets/QApplication:1,
                 from ../../../gopath/src/gopkg.in/qml.v1/cpp/capi.cpp:1,
                 from ../../../gopath/src/gopkg.in/qml.v1/all.cpp:2:
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:46:35: error: '_U' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:47:32: error: '_L' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:48:32: error: '_U' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:48:37: error: '_L' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:49:32: error: '_N' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:50:33: error: '_X' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:50:38: error: '_N' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:51:32: error: '_S' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:52:32: error: '_P' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:52:37: error: '_U' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:52:42: error: '_L' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:52:47: error: '_N' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:52:52: error: '_B' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:53:32: error: '_P' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:53:37: error: '_U' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:53:42: error: '_L' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:53:47: error: '_N' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:54:32: error: '_C' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:55:32: error: '_P' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:56:32: error: '_U' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:56:37: error: '_L' was not declared in this scope
/home/geertjohan/Applications/android-ndk-toolchain/bin/../lib/gcc/../../include/c++/4.6/arm-linux-androideabi/bits/ctype_base.h:56:42: error: '_N' was not declared in this scope
niemeyer commented 9 years ago

That looks like an issue with the development environment. That iterator file being included by qlist.h is a standard C++ header, and it's supposed to work. A couple of links which might help:

http://stackoverflow.com/questions/11444875/qt-necessitas-cryptic-ctype-base-h-errors-when-linking-gnu-libstdc https://code.google.com/p/android/issues/detail?id=62494