Hah. Since you named the program file SDL.pas, when FPC encountered "uses SDL", it began to look for the SDL unit, and the first thing it saw was... SDL.pas. Which was not a unit, and that's why the compiler shouted about interface and implementation, which are unit parts.

Also, about the output - first thing, I guess you would want the writeln to be executed only if there actually is a problem and screen is NIL - begin end block? And putting it before halt. As for the SetVideoMode failing - I don't see a reason why would You need 32 bits for a display surface; type in either 24 or 0 (which will create a surface with a depth resembling the one currently used in the user's OS). You can eventually add the SDL_AnyFormat flag.