I got a similar error. I can't remember how I have solved it, but if it can help you, here is a pastebin ([size=9px]thanks WILL [/size]) of my sdl.pas