
After extracting the SDL2 source code you should have an Android makefile at 'C:\androidlib\SDL2-2.0.5\Android.mk'. For this tutorial we will put them in the directory 'C:\androidlib'.
Sdl for windows cmake driver#
(I used the CMake GUI to generate the Makefile in Windows 10). CMake Google USB Driver NDK 9) Extract the SDL2 source code to some accessable directory that is ideally dedicated to containing Android libraries. I have put SDL2.dll and libSDL2main.a into the root of the project directory. Target_link_libraries(exe0 libSDL2main.a) Select latest Windows SDK even when targeting Windows 8.1 and below CMake 3.27.2 Christian Oyarzun (1): FindJNI.

Here is my CMakeLists.txt cmake_minimum_required(VERSION 3.10) The CMake build system is supported on the following platforms: FreeBSD Linux Microsoft Visual C MinGW and Msys macOS, iOS, and tvOS, with support for. Makefile:102: recipe for target 'all' failed
Sdl for windows cmake install#
I get an error when I try to link the libSDL2main.a file (running the Makefile using cmd mingw32-make) Linking CXX executable exe0.exeĬ:/mingw/bin/./lib/gcc/mingw32/8.2.0/././././mingw32/bin/ld.exe: cannot find -llibSDL2mainĬollect2.exe: error: ld returned 1 exit statusĬMakeFiles\exe0.dir\build.make:105: recipe for target 'exe0.exe' failedĬMakeFiles\Makefile2:94: recipe for target 'CMakeFiles/exe0.dir/all' failed cmake sdl2 Installing CMake Most common distributions have cmake available on their package manager repostories: Debian based sudo apt install cmake Arch pacman -S cmake Install SDL2 libraries I only know about the debian based ones, if you are on another distro you should look them up. In Include Path, add the path to your SDL2 includes. Like we put in the tasks.json and change the IntelliSense mode to gcc圆4. In Compiler Path, you need to put the path to your compiler. Here we’re are going to change some configurations.

set(WINDOWS TRUE) endif() elseif(UNIX AND NOT APPLE) if(CMAKESYSTEMNAME. I know that there is another way around using find_file which is easy. In Visual Studio Code, press CTRL + SHIFT + P, write C/C++ and select C/C++ Edit configurations (GUI). Please create a build directory outside of the SDL source code and call cmake. To practice, I am trying to link SDL2 manually.
