PDA

View Full Version : Problems compiling sdl.pas with D2010



chronozphere
11-12-2010, 11:03 PM
Hey PGD-friends. :)

I just installed Delphi 2010 (Needed an update as I was still using BDS2006). However, I can't compile my engine anymore.



{$IFDEF __MACH__}
GPCMacOSAll;
{$ENDIF}

const //<<< ERROR HERE:
{$IFDEF WINDOWS}
SDLLibName = 'SDL.dll';
{$ENDIF}


It says:



[DCC Error] sdl.pas(358): E2029 Identifier expected but 'CONST' found


If I put an arbitrary unit in the uses clause and close with a semilicon, the problem is solved, but another one will pop up:



[DCC Error] sdl.pas(2217): E2003 Undeclared identifier: 'Sem_t'


What's going on here? :o

Thanks

chronozphere
12-12-2010, 03:00 PM
I solved my problem by adding the following to the jedi-sdl.inc file:



{$IFDEF ver200}
{$DEFINE Delphi} {Delphi 2009}
{$DEFINE Delphi32}
{$DEFINE Delphi4UP}
{$DEFINE Delphi5UP}
{$DEFINE Delphi6UP}
{$DEFINE Delphi7UP}
{$DEFINE Delphi8UP}
{$DEFINE Delphi9UP}
{$DEFINE Delphi10UP}
{$DEFINE Delphi11UP}
{$DEFINE Delphi12UP}
{$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
{$DEFINE Has_Int64}
{$DEFINE HAS_TYPES}
{$ENDIF ver200}

{$IFDEF ver210}
{$DEFINE Delphi} {Delphi 2010}
{$DEFINE Delphi32}
{$DEFINE Delphi4UP}
{$DEFINE Delphi5UP}
{$DEFINE Delphi6UP}
{$DEFINE Delphi7UP}
{$DEFINE Delphi8UP}
{$DEFINE Delphi9UP}
{$DEFINE Delphi10UP}
{$DEFINE Delphi11UP}
{$DEFINE Delphi12UP}
{$DEFINE Delphi13UP}
{$WARN UNSAFE_TYPE OFF} {Disable warning for unsafe types in Delphi 7}
{$DEFINE Has_Int64}
{$DEFINE HAS_TYPES}
{$ENDIF ver200}


:)

paul_nicholls
06-08-2011, 12:48 PM
Nice fix Nathan! I had exactly the same issue today when I was trying to compile SDL.pas under D2010, but it worked in Lazarus...

It is now solved thanks to you :)

cheers,
Paul