Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can this library work within a Qt project for Android using Qt Creator? #1178

Closed
daljit97 opened this issue Jul 30, 2018 · 5 comments
Closed
Labels
platform: android related to Android NDK

Comments

@daljit97
Copy link

I am using this library inside my Qt Project for Android. I am using Qt Creator and everything builds fine in Linux and I am able to run the program on my desktop without problems. However, when I try to compile the project for Android then I get errors like:
'to_string' is not a member of 'std' 'strtof' ist not a member of 'std' etc.

I know this is related to the NDK having issues with C++11. Is there any solution to make this work with Qt? I know in Android Studio is possible to edit the Application.mk, but is there any solution for Qt?
I am aware that this might not be an issue with the library itself, but wondering if there is someone that could help me solve this.

@nguoithichkhampha
Copy link

@daljit97 , I don't use Qt project for Android yet. But I can build successfully this library in a project for Android with cmake and ndk.
this is some info may useful for you
-- BUILD CORTEX FOR ANDROID ON APPLE -- Android: Targeting API '21' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a' -- Android: Selected GCC toolchain 'arm-linux-androideabi-4.9' -- The C compiler identification is GNU 4.9.0 -- The CXX compiler identification is GNU 4.9.0 -- Check for working C compiler: /Users/sdkteam/usr/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc -- Check for working C compiler: /Users/sdkteam/usr/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Users/sdkteam/usr/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -- Check for working CXX compiler: /Users/sdkteam/usr/android/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++ -- works

@nlohmann
Copy link
Owner

Please have a look at the section https://github.com/nlohmann/json#supported-compilers - it explicitly mentions the 'to_string' is not a member of 'std' error message.

@daljit97
Copy link
Author

@nlohmann thanks for that. As suggested at that page, the NDK uses an old stl implementation and the solution is to modify Application.mk in an Android project or "manually" implement the missing functions using templates. Now I would really like to avoid the second option and the first option is not viable to me since a Qt Project usually don't generate .mk files and I am not aware of how to incorporate them in my project.

@daljit97
Copy link
Author

@nguoithichkhampha hmm cmake might be a possibility (but I am not familiar with it), however I am using the default qmake that is used in Qt Creator.

@nlohmann nlohmann added the platform: android related to Android NDK label Aug 1, 2018
@nlohmann
Copy link
Owner

@daljit97 Do you need further assistance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: android related to Android NDK
Projects
None yet
Development

No branches or pull requests

3 participants