这段代码给了我一个错误:
uses SDL
uses SDLGraphics
uses SDLImage
screen: unowned SDL.Screen
alto: int16=400
ancho:int16 =600
imagen: SDL.Surface
src: SDL.RWops
init
SDL.init(SDL.InitFlag.VIDEO)
screen = SDL.Screen.set_video_mode (ancho, alto, 30, SurfaceFlag.FULLSCREEN | SurfaceFlag.DOUBLEBUF | SurfaceFlag.HWACCEL | SurfaceFlag.HWSURFACE)
var fin = false
var y=110
var x=100
var radius=10
var color=1003232242
var mov_x=1
var mov_y=3
src = new SDL.RWops.from_file ("/home/gontzal/Mahaigaina/boy.png", "rb")
imagen = SDLImage.load_png (src)
while fin == false
event: SDL.Event
while (Event.poll (out event))== 1
if event.type ==SDL.EventType.QUIT
print "adios"
fin= true
break
else if event.type == EventType.KEYDOWN
fin=true
break
if x>ancho do mov_x=-mov_x
if x<0 do mov_x=-mov_x
if y>alto do mov_y=-mov_y
if y<0 do mov_y=-mov_y
x=x+mov_x
y=y+mov_y
Circle.fill_color (screen, x, y, radius, color);
Circle.outline_color_aa (screen, x, y, radius, color);
Rectangle.fill_color(screen,0, 0,ancho, alto,1801222)
screen.flip()
SDL.quit()
错误:valac --pkg sdl --pkg sdl-gfx --pkg sdl-image -X -lSDL_gfx“SDL.gs”(在目录中:/home/gontzal)/tmp/ccMPg7h0.o:在函数_vala_main':
SDL.vala.c:(.text+0x115): undefined reference to
IMG_LoadPNG_RW'collect2 中: ld 返回 1 个退出状态编译失败:1 个错误,0 个警告错误:cc 退出,状态为 256 编译失败。