When I try to build my project, I get errors now. I didn’t change a thing and I was under the impression, that it did build a few years ago.
Can you please assist?
The error message is:
C/C++: ld: error: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/objs-debug/main/glbasic/glb-full.o: unable to find library from dependent library specifier: SDL.lib
C/C++: ld: error: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/objs-debug/main/glbasic/glb-full.o: unable to find library from dependent library specifier: SDL_mixer.lib
C/C++: ld: error: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/objs-debug/main/glbasic/glb-full.o: unable to find library from dependent library specifier: SDLmain.lib
C/C++: ld: error: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/objs-debug/main/glbasic/glb-full.o: unable to find library from dependent library specifier: SDL_mixer.lib
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
C/C++: make: *** [C:/Users/gf/AppData/Local/Android/Sdk/ndk/23.1.7779620/build//../build/core/build-binary.mk:715: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/libmain.so] Error 1
C/C++: ld: error: C:UsersgfDownloadsandroid-projectappbuildintermediatescxxDebug14s2b4rb/obj/local/arm64-v8a/objs-debug/main/glbasic/glb-full.o: unable to find library from dependent library specifier: SDL_mixer.lib
> Task :app:buildNdkBuildDebug[arm64-v8a] FAILED
You can find the project at:
https://www.glbasic.com/beta/twintris_as.zip
** UPDATE **
I changed the project and it is building, now. However, once I upgrade from gardle 7.2.2 to 7.3.0 or higher, I get the linker errors.
2
Answers
It appears as if you need to tell the compiler where to find the SDL libraries. You could follow the advice here: Linking errors with SDL_mixer library
You want to make sure those lib libraries are in a place the compiler can find as well.
I was able to compile your project by adding this line.
Inside the ‘build.gradle’ file related to the ‘app’
Inside the ‘externalNativeBuild’ scope Add this line like this: