Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-08

Error 216 with SDL

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Holger Peters

Hi,

I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and SDL4FreePascal doesn't work.
When I compile the demos, I get the runtime error 216 at the first SDLcommand.

Is there a solution?

Holger

James Mills
to Holger Peters
Holger Peters wrote 7 lines
Hi, I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and SDL4FreePascal doesn't work. When I compile the demos, I get the runtime error 216 at the first SDLcommand.

I used to get this runtime error a lot using FPC 1.0.6 running Debian... I can't remember what the cause was though or the solution :P When I do I'll let you know :)

Is there a solution?

All I can suggest is to debug the code, I believe the demos themselves aren't that good.

cheers
James

Show quoted text 9 lines
Holger _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Jonas Maebe
to Holger Peters: I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use…
Holger Peters wrote 7 lines
I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and SDL4FreePascal doesn't work. When I compile the demos, I get the runtime error 216 at the first SDLcommand. Is there a solution?

The problem may be that the SDL4FreePascal C-header translation was done for an older version than what you have now, so that type and function definitions are wrong now. There are two possible solutions:

a) install the same version of SDL on your system as what you were using before
b) translate the SDL headers of the new version to Pascal (or bug someone else to do it :)

Jonas

James Mills
to Jonas Maebe
Jonas Maebe wrote 19 lines
On maandag, aug 4, 2003, at 21:12 Europe/Brussels, Holger Peters wrote: >I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it >worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and >SDL4FreePascal doesn't work. >When I compile the demos, I get the runtime error 216 at the first >SDLcommand. > >Is there a solution? The problem may be that the SDL4FreePascal C-header translation was done for an older version than what you have now, so that type and function definitions are wrong now. There are two possible solutions: a) install the same version of SDL on your system as what you were using before b) translate the SDL headers of the new version to Pascal (or bug someone else to do it :)

Thanks Jonas :) I was clueless :P

James

Show quoted text 8 lines
Jonas _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
- -Zero Defect Software Engineers Group - ZDSEG - -You need only two tools. WD-40 and duct tape. -If it doesn't move and it should, use WD-40. -If it moves and shouldn't, use the tape.
Holger Peters
to Holger Peters: I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use…
Show quoted text 12 lines
Hi, I used SDL4FreePascal under Windows with FreePascal 1.0.6 and it worked fine. Now, I use RedHat 9.0 with FreePascal 1.0.10 and SDL4FreePascal doesn't work. When I compile the demos, I get the runtime error 216 at the first SDLcommand. Is there a solution? Holger

I tried to debug it via gdb, the first SDL function SDL_Init let's the program crash.

Now I tried to write a little include file with some functions, types and constants. I want to extend it, with the SDL Functions I need until it is complete.

But with this simple instructions, it doesn't work, to.

{$ifdef Linux}
{$LINKLIB pthread}
{$ENDIF}
{General}
const
        SDL_INIT_TIMER          = $00000001;
        SDL_INIT_AUDIO          = $00000010;
        SDL_INIT_VIDEO :Cardinal                = $00000032;
        SDL_INIT_CDROM          = $00000100;
        SDL_INIT_JOYSTICK       = $00000200;
        SDL_INIT_NOPARACHUTE    = $00100000; {Don't catch fatal signals}
        SDL_INIT_EVENTTHREAD    = $01000000; {Not supported on all Os's}
        SDL_INIT_EVERYTHING     = $0000FFFF;
type
        Uint32 = Cardinal;
function SDL_Init(Flags : Uint32) : Integer; cdecl; external 'SDL';
procedure SDL_Quit; cdecl; external 'SDL';
{Video}
{Sound}
{Events}

I've got this constants from the SDL.h on my PC.
It fails with the same error if you use this constants (except SDL_INIT_TIMER). But It works fine with values like 1,2,3,4... The function returns 0, that means that it was succesful (SDL-Documentation: Returns -1 on an error or 0 on success.)

I can't undestand the sense.

Holger

PS:

To test this Includefile, I used this program
program testsdl;
{$MODE OBJFPC}
{$MACRO ON}
{$INCLUDE sdlinc.inc}
begin
        WriteLn(SDL_Init(SDL_INIT_VIDEO));
        SDL_Quit;
end.