Code:
Code: Select all
#include
int main(int argc, char ** argv)
{
SDL_Init(SDL_INIT_VIDEO);
SDL_Window * screen = SDL_CreateWindow("My SDL Empty Window",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);
SDL_Delay(3000);
SDL_Quit();
return 0;
}
Compiler-/Linker-Ausgabe:
Code: Select all
$ g++ -lSDL2 hellosdl.cpp
/usr/bin/ld: /tmp/foobarbaz.o: in function `main':
hellosdl.cpp:(.text+0x18): undefined reference to `SDL_Init'
/usr/bin/ld: hellosdl.cpp:(.text+0x3c): undefined reference to `SDL_CreateWindow'
/usr/bin/ld: hellosdl.cpp:(.text+0x4c): undefined reference to `SDL_Delay'
/usr/bin/ld: hellosdl.cpp:(.text+0x50): undefined reference to `SDL_Quit'
collect2: error: ld returned 1 exit status
Meine gcc- und g++-Versionen sind beide g++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110 und meine Architektur (wie von uname -a zurückgegeben) ist aarch64. Ich hoffe, dass die Informationen von Nutzen sind.
Mobile version