JEDI-SDL doesn't compile on Linux

JEDI-SDL doesn't compile on Linux

Post by Dennis-Ben » Thu, 30 Sep 2004 06:57:06


Hello,

I'm trying to compile the latest release of JEDI-SDL on (SuSE) Linux
(8.0). I'm using FPC 1.0.10. I unpacked the SDL files in a folder within
my home directory and added the path to the fpc config file.
I wrote a little test app:

program jedi_sdl_test;
uses SDL;

var
screen_ : PSDL_Surface;
begin
// Initialize the SDL library
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) then
begin
//MessageBox(0, PChar(Format('Couldn''t initialize SDL : %s',
//[SDL_GetError])), 'Error', MB_OK or MB_ICONHAND);
// Clean up on exit
SDL_Quit;
exit;
end;

(*
* Initialize the display in a 640x480 8-bit palettized mode,
* requesting a software surface
*)
screen_ := SDL_SetVideoMode(640, 480, 8, SDL_SWSURFACE);
if ( screen_ = nil ) then
begin
//MessageBox(0, PChar(Format('Couldn''t set 840x480x8 video
mode : %s',
//[SDL_GetError])), 'Error', MB_OK or MB_ICONHAND);
SDL_Quit;
exit;
end;
end;

When I try to compile it, the compiler first has to compile the SDL
unit, but it doesn't work. I get the following error message(s):

sdl.pas(140,2) Warning: Illegal compiler directive $WEAKPACKAGEUNIT
sdl.pas(142,2) Warning: Unsupported switch $A
sdl.pas(157,6) Fatal: Can't find unit TYPES

Any suggestions what to do?

Thanks in advance,

regards,

Dennis Schramm
--
www.dennis-schramm.com
 
 
 

JEDI-SDL doesn't compile on Linux

Post by L D Blak » Thu, 30 Sep 2004 08:04:37

On Tue, 28 Sep 2004 23:57:06 +0200, Dennis-Bendert Schramm



Yep... deal with the errors reported by the compiler...

You've got two warnings concering compiler switches...

The first concerns a delphi-only switch {$WEAKPACKAGEUNIT} which applies to
making packages. It can be simply deleted from the source code with no ill
effects on what you are doing.

The second is warning about an unsupported switch {$A} ... again a delphi
switch which controls data alignment Try {$A4} or just delete it from the
source.

Finally find the unit named "Types" and put it where the compiler can find it.


-----
Laura

( http://www.yqcomputer.com/ )

 
 
 

JEDI-SDL doesn't compile on Linux

Post by Marco van » Thu, 30 Sep 2004 15:24:41


IIRC Jedi-SDL was ported using the 1.9.x series of stable snapshots, not the
older 1.0.x release.
 
 
 

JEDI-SDL doesn't compile on Linux

Post by Dennis-Ben » Fri, 01 Oct 2004 04:23:42

Marco van de Voort schrieb:


Now I installed FPC 1.9.4 and while trying to compile my little testapp
I get the following error messages:

sdl.pas(140,2) Warning: Illegal compiler directive "$WEAKPACKAGEUNIT"
sdl.pas(3481,3) Error: Identifier not found "Result"
sdl.pas(3494,3) Error: Identifier not found "Result"
sdl.pas(3494,23) Error: Illegal qualifier
sdl.pas(3494,23) Fatal: Syntax error, ";" expected but "identifier SEEK"
found

As far as I know "Result" is some standard variable of Delphi, but how
can I make it work with FPC?

Thanks in advance,

Dennis Schramm
--
www.dennis-schramm.com
 
 
 

JEDI-SDL doesn't compile on Linux

Post by Marco van » Fri, 01 Oct 2004 05:05:22


You probably got the stock SDL, which assumes that FPC is in Delphi mode.
Add -Sd to all your commandlines to fix this.

Alternately, I ported an older version of jedi-sdl as well as some demoes
to FPC. (mostly some release engineering fixes, not really porting)

That port is in FPC CVS under projects/contrib/sdl
 
 
 

JEDI-SDL doesn't compile on Linux

Post by Dennis-Ben » Fri, 01 Oct 2004 05:10:59

Marco van de Voort schrieb:


Thanks a lot. That worked. By the way... can I mix Delphi compability
with -Sd (for using JEDI-SDL) and Turbo Pascal compability with -So
(used by my self written main program) or do I have to expect errors or
unexpected behaviour?

Regards,

Dennis Schramm
--
www.dennis-schramm.com
 
 
 

JEDI-SDL doesn't compile on Linux

Post by Jonas Maeb » Fri, 01 Oct 2004 16:39:01

In article < XXXX@XXXXX.COM >,



As long as the code is in different units, it should be no problem. The
syntax modes only operate at the syntax level, the generated machine
code can perfectly work together (just like compiled code in C syntax
can also be called from Pascal code).

Just keep in mind that e.g. if you declare a variable as integer in a
file compiled in Delphi mode, it won't have the same size as such a
variable in a file compiled in TP mode. There is no problem accessing
them though, the compiler records the real size and not just some type
identifier.


Jonas
 
 
 

JEDI-SDL doesn't compile on Linux

Post by Marco van » Fri, 01 Oct 2004 17:59:07


In general, it can be mixed on a per unit basis.

However it can make errormsgs sometimes a bit confusing, since integer and
string are different between tp (integer=16-bit, string=shortstring, string
not typecastable to pchar ) and delphi mode (integer=32-bit and
string=ansistring, string typecastable to pchar). However this is not that
bad if you know it, and I told you now :-)