c - Install SDL in CLION -




i try install sdl in clion c project. dowload zip sdl ( librairies dev ), add include , lib folder , change cmakelist.txt :

cmake_minimum_required(version 3.8) project(projet1)  set(cmake_c_standard 99) include_directories( ${project_source_dir}/include) link_directories(${project_source_dir}/lib)  set(source_files main.c include lib) add_executable(projet1 ${source_files}) 

i have :

enter image description here

is configuration?

this problem separate clion, you'll need install sdl in whatever way supported or os (win32 exe, apt-get, brew, etc).

there cmake module called findsdl2 de-facto standard making cmake include sdl2. you'll want download file , put in folder called cmake in root of project.

after that, you'll want modify cmakelists.txt file :

cmake_minimum_required(version 2.8) project(project1)  # includes cmake/findsdl2.cmake set(cmake_module_path ${project_source_dir}/cmake)  find_package(sdl2 required) include_directories(${sdl2_include_dir})  set(source_files src/main.cpp)  add_executable(project1 ${source_files}) target_link_libraries(project1 ${sdl2_library}) 

this answer paraphrased this blog post.





wiki

Comments

Popular posts from this blog

python - Read npy file directly from S3 StreamingBody -

python - Minimize function with Scipy minimize -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -