You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ 50%] Linking C executable sdl
/usr/bin/cmake -E cmake_link_script CMakeFiles/sdl.dir/link.txt --verbose=1
/usr/bin/gcc CMakeFiles/sdl.dir/main.c.o -o sdl
CMakeFiles/sdl.dir/main.c.o: In function `main':
main.c:(.text+0x1e): undefined reference to `SDL_Init'
main.c:(.text+0x50): undefined reference to `SDL_CreateWindow'
main.c:(.text+0x60): undefined reference to `SDL_GetError'
main.c:(.text+0x85): undefined reference to `SDL_Delay'
main.c:(.text+0x91): undefined reference to `SDL_DestroyWindow'
main.c:(.text+0x96): undefined reference to `SDL_Quit'
collect2: error: ld returned 1 exit status
Whereas adding SDL2 to the target_link_libraries makes the program link properly. I'm not great at this sort of thing - why is this happening? Any idea? Shouldn't ${SDL_LIBRARY} be equivalent to SDL2?
Any help would be much appreciated, but I assume it's me being stupid, as opposed to the cmake script not being correct.
The text was updated successfully, but these errors were encountered:
When my CMakeLists.txt is this
I get the following linker error:
Whereas adding
SDL2
to thetarget_link_libraries
makes the program link properly. I'm not great at this sort of thing - why is this happening? Any idea? Shouldn't${SDL_LIBRARY}
be equivalent toSDL2
?Any help would be much appreciated, but I assume it's me being stupid, as opposed to the cmake script not being correct.
The text was updated successfully, but these errors were encountered: