0
RWops enemy_rwops = new RWops.from_file("img/enemy.png", "rb");
enemy = SDLImage.load_png(enemy_rwops);
我有代碼加載.png(敵人是一個SDL_Surface)。不過,我得到這個錯誤:加載PNG與SDLImage在Vala
/tmp/ccGDtjkw.o: In function `':
main.vala.c:(.text+0x59): undefined reference to `IMG_LoadPNG_RW'
collect2: error: ld returned 1 exit status
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)
這兩行是在我的構造函數,而我,的確是「使用SDLImage」,並在「--pkg」編譯行添加它:
valac --pkg sdl --pkg sdl-gfx --pkg sdl-image -X -lSDL_gfx -o mission- main.vala
有什麼建議嗎?