Comments (4)
In case someone else is facing this issue,, I got the build moving ahead by adding the following lines to each command that failed (I do not know how to fix the build scripts themselves):
./obj/local/x86/libfreetype.a
./obj/local/x86/libharfbuzz.a
./obj/local/x86/libfreetype.a \
Now I am facing another issue:
/media/iuri/SamsungEXT4/development/SDK/Android/Sdk/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -Wl,-soname,libsdl_main.so -shared ./obj/local/x86/objs/sdl_main/sdl_main.o ./obj/local/x86/libfreetype.a ./obj/local/x86/libharfbuzz.a ./obj/local/x86/libfreetype.a -lgcc -Wl,--exclude-libs,libgcc.a -latomic -Wl,--exclude-libs,libatomic.a ./obj/local/x86/libsdl-1.2.so ./obj/local/x86/libapplication.so -target i686-none-linux-android21 -no-canonical-prefixes -Wl,--exclude-libs,libgcc.a -Wl,--build-id -nostdlib++ -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--warn-shared-textrel -Wl,--fatal-warnings -llog -lc -lm -o ./obj/local/x86/libsdl_main.so
jni/../jni/sdl_main/sdl_main.c:135: error: undefined reference to 'SDL_main'
jni/../jni/sdl_main/sdl_main.c:59: error: undefined reference to 'SDL_main'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
from commandergenius.
from commandergenius.
Yeah, I know, but this error seems to happen well before it reaches my own code,, ut is on the SDL_main lib itself. But no worries, I'll keep trying until I get it working, or cherry pick an older commit.
from commandergenius.
All right, I took a bit of time and got my build working, but I did need some changes I will describe here so anyone in the future can find it.
I had to use -lc++ for the linker in my project, otherwise it would faild due to not finding ndk C++ classes like string and vector. In build.sh, I added the following to copy the lib from NDK to the app, after line ./copyAssets.sh:
pushd project &&
echo "### COPY LIBSTDC++ ###" &&
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so ./libs/armeabi-v7a/ &&
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ./libs/arm64-v8a/ &&
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./libs/x86_64/ &&
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./project/libs/x86/ && \
Also, the linker was breaking due to the harfbuzz, as previous stated, so I went into sdl_ttf/Android.mk and added it like this, LOCAL_STATIC_LIBRARIES := freetype harfbuzz, and also added it to my AndroidAppSettings.cfg both in CompiledLibraries and AppLdflags.
By looking at the logcat, when running the app, I found an error of it missing libmikmod.so, as the project was building it as static. While it did not crash due to that error, I found better to change it to shared, so in mikmod/Android.mk I used:
LOCAL_LDLIBS :=
include $(BUILD_STATIC_LIBRARY)
And in mikmod/mdreg.c I had to comment out line //_mm_registerdriver(&drv_raw);
And then, I moved the mikmod to shared in libsdl_mixer/Android.mk:
LOCAL_SHARED_LIBRARIES := sdl-1.2 mikmod
LOCAL_STATIC_LIBRARIES := flac
Sadly that still did not fix the audio issues playing mod files give in some devices.
With those changes, I was able to finally build my game again with latest version.
Once I have a bit of free time, I'll make separate MRs for harbuzz and mikmod fixes.
from commandergenius.
Related Issues (20)
- undefined reference to 'SDL_main' HOT 11
- fatal: Not a git repository (or any of the parent directories): .git
- running ./build.sh opentyrian results in an apk missing the assets files HOT 2
- debug always stripped, never signed HOT 6
- Help on how to emulate windows using android activities HOT 3
- Where do i look for command line arguments? HOT 6
- Intent Key HOT 1
- black screen after resume HOT 2
- OpenArena build.sh error ndk-build not found
- How to compile OA application.so.
- code/client/cl_main.c:27:10: fatal error: SDL_thread.h:No such file or directory
- How do you right click? (see strength of monsters) HOT 1
- Free heroes 2 android - cannot summon boat
- Ur quan for android hires doesn't work
- Unable to download Ur-Quan Masters Star Control 2 game content from Sourceforge server in app HOT 2
- Supertux for "Google TV" HOT 3
- [Mouse] OpenArena, XServer XSDL
- apk tries to unpack assets into wrong directory HOT 3
- Add support for usb gadget tool without kernel modifications HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commandergenius.