help with android compilation

Aleksander Kamenik aleksander.kamenik at gmail.com
Tue Nov 9 07:42:18 GMT 2021


The new file is present:

find /opt/android/ -name new
/opt/android/ndk/18.1.5063045/sources/cxx-stl/system/include/new
/opt/android/ndk/18.1.5063045/sources/cxx-stl/llvm-libc++/include/new
/opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/7.0.2/include/cuda_wrappers/new

I now discovered that at some point in testing using docker I forgot
to init and update the git submodules. I do that now and still have a
similar error.

I updated the https://github.com/kilx/gcompris-docker/blob/main/Dockerfile

When running cmake it reports:
---
-- You can export a target by specifying
-DQTANDROID_EXPORTED_TARGET=<targetname> and -DANDROID_APK_DIR=<paths>
-- You can export a target by specifying
-DQTANDROID_EXPORTED_TARGET=<targetname> and -DANDROID_APK_DIR=<paths>
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler:
/opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
- skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler:
/opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
- skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at
/usr/share/ECM/modules/ECMFindModuleHelpers.cmake:112 (message):
  Your project should require at least CMake 3.16.0 to use FindKF5.cmake
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:30 (ecm_find_package_version_check)
  CMakeLists.txt:118 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find KF5DocTools: found neither KF5DocToolsConfig.cmake
nor kf5doctools-config.cmake
Installing in /usr. Run /opt/build/build_android/prefix.sh to set the
environment for gcompris-qt.
-- Building build_openssl.sh.in
-- Did not find the qml-box2d module in system scope, falling back to
submodule build ...
-- Found Git: /usr/bin/git (found version "2.32.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/build/build_android
---

Note the:
---
Did not find the qml-box2d module in system scope, falling back to
submodule build ...
---

However it is present in gcompris/external.

Also, is the following warning important? cmake is version 3.18.4 but
I don't have the kf5doc* files anywhere.
---
CMake Warning (dev) at
/usr/share/ECM/modules/ECMFindModuleHelpers.cmake:112 (message):
  Your project should require at least CMake 3.16.0 to use FindKF5.cmake
Call Stack (most recent call first):
  /usr/share/ECM/find-modules/FindKF5.cmake:30 (ecm_find_package_version_check)
  CMakeLists.txt:118 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Could NOT find KF5DocTools: found neither KF5DocToolsConfig.cmake
nor kf5doctools-config.cmake
Installing in /usr. Run /opt/build/build_android/prefix.sh to set the
environment for gcompris-qt.
---

After running cmake the ./qml_box2d-prefix/src/qml_box2d-build
directory is empty.

After running make with the following output the Makefile is created though.
---
Scanning dependencies of target BuildTranslations
[  0%] Built target BuildTranslations
Scanning dependencies of target createShareFolders
[  0%] Generating shareFolders
[  0%] Built target createShareFolders
Scanning dependencies of target qml_box2d
[  0%] Creating directories for 'qml_box2d'
[  0%] No download step for 'qml_box2d'
[  0%] No update step for 'qml_box2d'
[  0%] No patch step for 'qml_box2d'
[  0%] Performing configure step for 'qml_box2d'
Info: creating stash file
/opt/build/build_android/qml_box2d-prefix/src/qml_box2d-build/.qmake.stash
[  1%] Performing build step for 'qml_box2d'
../../../../gcompris/external/qml-box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp:20:10:
fatal error: 'new' file not found
#include <new>
         ^~~~~
1 error generated.
make[4]: *** [Makefile.Armeabi-v7a:2697: .obj/b2PolygonShape.o] Error 1
make[3]: *** [Makefile:48: armeabi-v7a-all] Error 2
make[2]: *** [CMakeFiles/qml_box2d.dir/build.make:130:
qml_box2d-prefix/src/qml_box2d-stamp/qml_box2d-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:4273: CMakeFiles/qml_box2d.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
---

However what you mention is not present in that file:

grep -Ei 'CXX|llvm|include' ./qml_box2d-prefix/src/qml_box2d-build/Makefile
(no result)






On Mon, Nov 8, 2021 at 11:25 PM Johnny Jazeix <jazeix at gmail.com> wrote:
>
> Hi,
>
> on my computer:
> find /opt/android-*/ -name new
> /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/7.0.2/include/cuda_wrappers/new
> /opt/android-ndk/sources/cxx-stl/system/include/new
> /opt/android-ndk/sources/cxx-stl/llvm-libc++/include/new
>
> In the ./qml_box2d-prefix/src/qml_box2d-build/Makefile file, do you have "-isystem /opt/android-ndk/sources/cxx-stl/llvm-libc++/include" in you CXXFLAGS?
>
> Johnny
>
> Le lun. 8 nov. 2021 à 17:07, Aleksander Kamenik <aleksander.kamenik at gmail.com> a écrit :
>>
>> The ndk is as instructed 18, sdk is at API 25.
>>
>> I made a Dockerfile where I reproduce the problem, here it is:
>>
>> https://github.com/kilx/gcompris-docker
>>
>> It's a bit messy with some extra packages I think, I'll clean up once
>> I get it working.
>>
>> Thanks for looking into this.
>>
>> This isn't really a GCompris problem but some basic setup thing with
>> clang not finding the required libstdc++ libraries, I think.
>>
>> But I'm not familiar with C++ so not sure where to look for this <new> include.
>>
>> On Mon, Nov 8, 2021 at 2:54 PM Johnny Jazeix <jazeix at gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > QmlModels have been added recently and Xml/XmlPatterns have been removed a few weeks ago, we haven't updated the doc yet.
>> >
>> > I don't have access to my dev environment for a few hours so I can only give you a few tracks to explore until then.
>> > Here it fails when compiling the submodule box2d. Which ndk/sdk versions have you installed? In one of them (I think sdk but not sure), is there a "new" file in the include?
>> >
>> > Johnny
>> >
>> > Le lun. 8 nov. 2021 à 13:36, Aleksander Kamenik <aleksander.kamenik at gmail.com> a écrit :
>> >>
>> >> Hi!
>> >>
>> >> Yes, of couse. Without that I wouldn't have gotten this far.
>> >>
>> >> Had to add -DQt5QmlModels_DIR as well to the cmake command and I think
>> >> a couple of the -D switches are not actually needed:
>> >>
>> >> CMake Warning:
>> >>   Manually-specified variables were not used by the project:
>> >>
>> >>     Qt5XmlPatterns_DIR
>> >>     Qt5Xml_DIR
>> >>
>> >> But everything else is in place. Used the same page to get it to
>> >> successfully compile the Linux version.
>> >>
>> >> Regards,
>> >> Alex
>> >>
>> >> On Mon, Nov 8, 2021 at 2:20 PM Johnny Jazeix <jazeix at gmail.com> wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > have you followed https://gcompris.net/wiki/Qt_Quick_development_process#Compiling_GCompris_for_Android?
>> >> >
>> >> > Johnny
>> >> >
>> >> > Le lun. 8 nov. 2021 à 12:39, Aleksander Kamenik <aleksander.kamenik at gmail.com> a écrit :
>> >> >>
>> >> >> Hi!
>> >> >>
>> >> >> I have been playing around with GCompris on Linux and now want to
>> >> >> build the Android version as well for use on a tablet.
>> >> >>
>> >> >> However I've been stuck with clang not finding libstdc++ (or at least
>> >> >> that's what I guess is the problem). The error is this:
>> >> >>
>> >> >> /opt/android/ndk/18.1.5063045/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
>> >> >> -c -target armv7a-linux-androideabi21 -fno-limit-debug-info -fPIC
>> >> >> -fstack-protector-strong -DANDROID -O2 -mthumb -Oz -fvisibility=hidden
>> >> >> -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG
>> >> >> -DQT_PLUGIN -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB
>> >> >> -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
>> >> >> -I../../../../external/qml-box2d -I. -I../../../../external/qml-box2d
>> >> >> -I../../../../external/qml-box2d/Box2D
>> >> >> -I/opt/qt/5.15.2/android/include
>> >> >> -I/opt/qt/5.15.2/android/include/QtQuick
>> >> >> -I/opt/qt/5.15.2/android/include/QtGui
>> >> >> -I/opt/qt/5.15.2/android/include/QtQmlModels
>> >> >> -I/opt/qt/5.15.2/android/include/QtQml
>> >> >> -I/opt/qt/5.15.2/android/include/QtNetwork
>> >> >> -I/opt/qt/5.15.2/android/include/QtCore -I.moc
>> >> >> -I/opt/qt/5.15.2/android/mkspecs/android-clang -o
>> >> >> .obj/b2PolygonShape.o
>> >> >> ../../../../external/qml-box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp
>> >> >> ../../../../external/qml-box2d/Box2D/Collision/Shapes/b2PolygonShape.cpp:20:10:
>> >> >> fatal error: 'new' file not found
>> >> >> #include <new>
>> >> >>          ^~~~~
>> >> >> 1 error generated.
>> >> >>
>> >> >> I'm on Ubuntu 21.10 and just can't figure out what package I'm
>> >> >> missing. Here's what's installed atm (many of these are obviously not
>> >> >> needed):
>> >> >>
>> >> >> # dpkg --list | grep ++
>> >> >> +++-=============================-==================================-============-===============================================================================
>> >> >> ii  g++                           4:11.2.0-1ubuntu1
>> >> >> amd64        GNU C++ compiler
>> >> >> ii  g++-11                        11.2.0-7ubuntu2
>> >> >> amd64        GNU C++ compiler
>> >> >> ii  g++-11-multilib               11.2.0-7ubuntu2
>> >> >> amd64        GNU C++ compiler (multilib support)
>> >> >> ii  g++-multilib                  4:11.2.0-1ubuntu1
>> >> >> amd64        GNU C++ compiler (multilib files)
>> >> >> ii  lib32stdc++-11-dev            11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3 (development files)
>> >> >> ii  lib32stdc++6                  11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3 (32 bit Version)
>> >> >> ii  libjsoncpp24:amd64            1.9.4-4build1
>> >> >> amd64        library for reading and writing JSON for C++
>> >> >> ii  libpcrecpp0v5:amd64           2:8.39-13build3
>> >> >> amd64        Old Perl 5 Compatible Regular Expression Library - C++
>> >> >> runtime files
>> >> >> ii  libstdc++-11-dev:amd64        11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3 (development files)
>> >> >> ii  libstdc++-11-dev-arm64-cross  11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (development files) (arm64)
>> >> >> ii  libstdc++-11-dev-armhf-cross  11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (development files) (armhf)
>> >> >> ii  libstdc++-11-dev-i386-cross   11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (development files) (i386)
>> >> >> ii  libstdc++-11-pic-armhf-cross  11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (shared library subset kit)
>> >> >> (armhf)
>> >> >> ii  libstdc++6:amd64              11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3
>> >> >> ii  libstdc++6-arm64-cross        11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (arm64)
>> >> >> ii  libstdc++6-armhf-cross        11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (armhf)
>> >> >> ii  libstdc++6-i386-cross         11.2.0-5ubuntu1cross1
>> >> >> all          GNU Standard C++ Library v3 (i386)
>> >> >> ii  libx32stdc++-11-dev           11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3 (development files)
>> >> >> ii  libx32stdc++6                 11.2.0-7ubuntu2
>> >> >> amd64        GNU Standard C++ Library v3 (x32)
>> >> >>
>> >> >> Can anybody give a hint on what is missing?
>> >> >>
>> >> >> Thanks!
>> >> >> --
>> >> >> Aleksander Kamenik
>> >>
>> >>
>> >>
>> >> --
>> >> Aleksander Kamenik
>>
>>
>>
>> --
>> Aleksander Kamenik



--
Aleksander Kamenik


More information about the GCompris-devel mailing list