Hi there, I’m really interested in starting my next project using SDL with Android. I’ve managed to build and compile the sample project using Android Studio but I much prefer working in Visual Studio.
Searching around and reading the README-android I saw that Matt Styles guide is mentioned to get a working setup (https://trederia.blogspot.com/2017/03/building-sdl2-for-android-with-visual.html). I’ve followed this guide as and every time I attempt to build a project in Release mode I get a linker error - Clang.exe exited with code 1. This error occurs when the “main” project is compiled. I’ve also tried to use the provided sample project on Git and still get the same issue. I’m not sure what exit code 1 means, from what I can determine looking around it could mean that I don’t have clang setup/installed?
Before the error, my log file outputs:
2>C:\Microsoft\AndroidNDK64\android-ndk-r15c\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/…/…/…/…/arm-linux-androideabi/bin\ld: error: cannot find -lSDL2
2> undefined reference to ‘SDL_Android_Init’
2> undefined reference to ‘SDL_SetMainReady_REAL’
2> undefined reference to ‘SDL_strdup_REAL’
2> undefined reference to ‘SDL_strdup_REAL’
2> undefined reference to ‘SDL_strdup_REAL’
2> undefined reference to ‘SDL_free_REAL’
2> undefined reference to ‘SDL_Init’
2> undefined reference to ‘SDL_CreateWindow’
2> undefined reference to ‘SDL_Delay’
2> undefined reference to ‘SDL_DestroyWindow’
2> undefined reference to ‘SDL_Quit’
2> undefined reference to ‘SDL_GetError’
2>clang.exe: error: linker command failed with exit code 1 (use -v to see invocation)
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Application Type\Android\3.0\Android.Common.targets(104,5): error MSB6006: “clang.exe” exited with code 1.
2>Done building project “main.vcxproj” – FAILED.
What am I doing wrong? Anyone had any luck with this?
Just to note my machine is running Windows 10 and I’m using the Enterprise version of Visual Studio 2017. I’ve uninstalled and re-installed it multiple times with all the optional packages included (i.e mobile development ect)