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

Build problem with libc++ #105

Open
protoman opened this issue Jun 18, 2019 · 1 comment
Open

Build problem with libc++ #105

protoman opened this issue Jun 18, 2019 · 1 comment

Comments

@protoman
Copy link

Hello.
I am trying to move from my own build system to the one from your SDL and also moving to clang from gcc, as support for gcc was dropped by google and we'll need to build for arm-64.
Anyway, when building, I got error with some basic C++ stuff on linker:
/home/iuri/Programas/android-studio/sdk/android-ndk-r20/sources/cxx-stl/llvm-libc++/include/ostream:275: error: undefined reference to 'std::uncaught_exception()'
/home/iuri/Programas/android-studio/sdk/android-ndk-r20/sources/cxx-stl/llvm-libc++/include/new:320: error: undefined reference to 'operator delete(void*)'
/home/iuri/Programas/android-studio/sdk/android-ndk-r20/sources/cxx-stl/llvm-libc++/include/new:239: error: undefined reference to 'operator new(unsigned int)'

The solution was to add AppLdflags='-lstdc++'. That fixes the build. But the thing is that, when running the app, it gives this error:
06-18 11:19:01.328 22704 22720 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found

While I can change your script to copy this shared library from the NDK to the libs folder so the generated APK will contain it, I wanted to know if I am doing something wrong in the build in first place.

I had to include llvm-libc++ dirs for it to find the headers, so that may be the reason:
AppCppflags='-DANDROID -DHANDHELD -std=c++11 -I/home/iuri/Programas/android-studio/sdk/android-ndk-r20/sources/cxx-stl/llvm-libc++/include -I. -I./rockdroid -I./rockdroid/aux_tools -I./rockdroid/character -I./rockdroid/character/movement -I./rockdroid/file -I./rockdroid/file/format -I./rockdroid/file/v4 -I./rockdroid/graphic -I./rockdroid/objects -I./rockdroid/options -I./rockdroid/ports/android -I./rockdroid/scenes'

Also, I am using lastest ndk (r20) and APP_PLATFORM=android-21

Thanks.

@pelya
Copy link
Owner

pelya commented Jan 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants