Issue
I am using the CMake template from Visual Studio, with WSL: Ubuntu.
When compiling I get:
libSDL2_image.so, needed by 'SDL_prototype/SDL_prototype', missing and no known rule to make it
I downloaded SDL2_image-devel-2.8.2-mingw.tar.gz
from the SDL2_image github releases page.
I have the SDL2_image-devel in my project directory, telling my CMake where it is using PATHS
keyword on the find_package()
function.
I am linking the libraries with:
target_link_libraries(SDL_prototype SDL2::SDL2 SDL2::SDL2main)
target_link_libraries(SDL_prototype SDL2_image::SDL2_image)
Also, when printing SDL2_IMAGE_INCLUDE_DIRS
& SDL2_IMAGE_LIBRARY
, it shows blank.
What I Have Tried
I have tried linking SDL_image in a couple of ways, every time deleting cache and reconfiguring:
-
I would get a segmentation fault from using
target_link_libraries()
on thelibSDL2_image.a
file:
../../../~linux_LIB/SDL2-2.30.1/x86_64-w64-mingw32/lib/libSDL2.dll.a(SDL2_dll_d000613.o):(.idata$7+0x0): dangerous relocation: collect2: fatal error: ld terminated with signal 11 [Segmentation fault]
-
linking with
target_link_libraries(SDL_prototype ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARY})
hasnt worked,
giving me ‘no such file or directory’ on SDL_image stuff. -
I have tried getting SDL through
apt get
and finding package without thePATHS
keyword, getting me :
Could not find a package configuration file provided by "SDL2_image"
when configuring CMake.
This is my first time using CMake, or building for linux, any help would be appreciated. 🙂
DrCowiber is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.