Question about linking SDL2 on Debian 12
by Mac1ek from LinuxQuestions.org on (#6J03D)
Hello!
I have problem on Debian 12. When I try linking simple program with SDL2 library i have error:
/usr/bin/ld: /tmp/cc6bgbfu.o: in function `main':
sdl_test.cpp:(.text+0x15): undefined reference to `SDL_Init'
collect2: error: ld returned 1 exit status
I have no idea why i cant linking with SDL2.
Simple main:
#include <SDL2/SDL.h>
auto main(int argc, char** argv) -> int {
SDL_Init(SDL_INIT_EVERYTHING);
return (0);
}
Can some one answer my why i have error ? Library is installed :
ls /usr/lib/x86_64-linux-gnu/ | grep libSDL*
libSDL2-2.0.so
libSDL2-2.0.so.0
libSDL2-2.0.so.0.2600.5
libSDL2.a
libSDL2main.a
libSDL2.so
libSDL2_test.a
Il try send to g++ different options with path, using sdl-config, etc..
Thank You for answer.
I have problem on Debian 12. When I try linking simple program with SDL2 library i have error:
/usr/bin/ld: /tmp/cc6bgbfu.o: in function `main':
sdl_test.cpp:(.text+0x15): undefined reference to `SDL_Init'
collect2: error: ld returned 1 exit status
I have no idea why i cant linking with SDL2.
Simple main:
#include <SDL2/SDL.h>
auto main(int argc, char** argv) -> int {
SDL_Init(SDL_INIT_EVERYTHING);
return (0);
}
Can some one answer my why i have error ? Library is installed :
ls /usr/lib/x86_64-linux-gnu/ | grep libSDL*
libSDL2-2.0.so
libSDL2-2.0.so.0
libSDL2-2.0.so.0.2600.5
libSDL2.a
libSDL2main.a
libSDL2.so
libSDL2_test.a
Il try send to g++ different options with path, using sdl-config, etc..
Thank You for answer.