ggerganov / kbd-audio

🎤⌨️ Acoustic keyboard eavesdropping
https://ggerganov.github.io/keytap
MIT License
8.55k stars 588 forks source link

cmake: Could not find a package configuration file provided by "SDL2" #17

Closed ritiek closed 5 years ago

ritiek commented 5 years ago

I had this error when running cmake:

$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
CMake Warning at CMakeLists.txt:28 (find_package):
  By not providing "FindSDL2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SDL2", but
  CMake did not find one.

  Could not find a package configuration file provided by "SDL2" with any of
  the following names:

    SDL2Config.cmake
    sdl2-config.cmake

  Add the installation prefix of "SDL2" to CMAKE_PREFIX_PATH or set
  "SDL2_DIR" to a directory containing one of the above files.  If "SDL2"
  provides a separate development package or SDK, be sure it has been
  installed.

-- Found FFTW: /usr/lib/x86_64-linux-gnu/libfftw3.so;/usr/lib/x86_64-linux-gnu/libfftw3f.so
CMake Warning at CMakeLists.txt:32 (message):
  Unable to find SDL2 library.  It is either not installed or CMake cannot
  find it.  In the latter case, setting the USE_FINDSDL2 variable might help:

     $ cmake -D USE_FINDSDL2 ..

CMake Error at CMakeLists.txt:37 (message):
  Aborting

-- Configuring incomplete, errors occurred!
See also "/home/ritiek/Downloads/kbd-audio/build/CMakeFiles/CMakeOutput.log".
See also "/home/ritiek/Downloads/kbd-audio/build/CMakeFiles/CMakeError.log".

Installing libsdl2-dev fixed it for me:

$ sudo apt install libsdl2-dev

It may be helpful to note this in README.md

ggerganov commented 5 years ago

Added a note to the README.md as suggested.

arjunskumar commented 2 years ago

Thanks @ritiek

brunolm commented 10 months ago

On Windows download this

image

Rename the folder to SDL2 and put on your project folder.