Following the instructions here, I've set up a CMakeLists.txt
:
Find_Package (SDL REQUIRED)
Find_Package (SDL_image REQUIRED)
link_libraries (
${SDL_LIBRARY}
${SDLIMAGE_LIBRARY}
SDLmain
)
When running cmake
, I get the following error:
ld: library not found for -lSDLmain
collect2: error: ld returned 1 exit status
make[2]: *** [src/GameOfLife] Error 1
Running g++
by hand gives the same error:
$ g++-4.7 -std=c++0x ../src/*.cpp -lSDLmain
ld: library not found for -lSDLmain
How do I fix this?