Pregunta

RWops enemy_rwops = new RWops.from_file("img/enemy.png", "rb");
enemy = SDLImage.load_png(enemy_rwops);

I have that code to load a .png (enemy is a SDL_Surface). However, I get this error:

/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)

Those two lines are in my constructor, and I am, indeed "using SDLImage" and adding it in the "--pkg" compile line:

valac --pkg sdl --pkg sdl-gfx --pkg sdl-image -X -lSDL_gfx -o mission- main.vala

Any ideas?

¿Fue útil?

Solución

valac --pkg sdl --pkg sdl-gfx --pkg sdl-image -X -lSDL_gfx -X -lSDL_image  --Xcc=-I/usr/include/SDL -o game main.vala

Got it, just use that compile line.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top