Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)

linux  sdl2  cmake安装

How to use SDL2 and SDL_image with cmake

https://stackoverflow.com/questions/23850472/how-to-use-sdl2j-and-sdl-image-with-cmake

 

Using SDL2 with CMake

https://trenki2.github.io/blog/2017/06/02/using-sdl2-with-cmake/

我没有按照上面的编译,结果出现了问题:Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)

sudo apt-get install libsdl2-dev

sudo apt-get install cmake3

问题:

Could NOT find SDL (missing: SDL_LIBRARY SDL_INCLUDE_DIR)

发现自己的目录中是FindSDL.cmake

/usr/share/cmake-3.*/Modules/FindSDL.cmake

进入目录https://github.com/brendan-w/collector

下载编译。将编译好的FindSDL2.cmake 替换掉上面链接中的FindSDL.cmake,就可以了。

好像cmake默认是有SDL版本的,用SDL2要重新编译。

 

 

你可能感兴趣的:(环境搭建)