PDA

View Full Version : Installing Lazarus & JEDI-SDL WILL's Way



WILL
31-12-2006, 05:48 AM
These are instructions on how to install JEDI-SDL for Lazarus:

1) JEDI-SDL Installation: Go to the JEDI-SDL project (http://sourceforge.net/projects/jedi-sdl/) at SourceForge and download (http://sourceforge.net/project/showfiles.php?group_id=43805) JEDI-SDL 1.0 BETA!

a. Once you've finished downloading, extract the JEDI-SDLv1.0 folder into the location you want to store all your libraries. On my setup I have a folder in My Documents called Pascal Projects and my copy of JEDI-SDL resides there. Either way, just REMEMBER this path, you'll need it in the setup.

2) Lazarus/JEDI-SDL Setup: Start up Lazarus if you don't already have it open. Create a new project for the purposes of demonstration.

NOTE: Unfortunately I've not found a way to setup a universal path for all libraries used in Laz so far... Perhaps they'll put this in for 1.0.

a. In the main menu go to Project -> Compiler Options... and if the Paths tab is not already open go into it now.

b. In the 'Other Unit Files (-Fu)' field put in the following, substituting my path for the one that you use for your own copy of JEDI-SDL. (I recommend using the '...' button. ;))


C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\OpenGL\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\fmod\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\ODE\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Image\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Mixer\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Net\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_Sound\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL_ttf\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLFilter\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLMonoFonts\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDLSpriteEngine\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SFont\Pas\
C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\smpeg\Pas\

c. Now to be able to find the include file put this into the 'Include Files (-Fi)' field substituting the same as you did before:


C:\Documents and Settings\WILL\My Documents\Pascal Projects\JEDI-SDLv1.0\SDL\Pas\

3) JEDI-SDL Usage:

a. Now in any project you wish to use SDL in simply add 'sdl' to your uses clause as thus:

uses
sdl;


Ta-da! You're done! :)

It might also give you some insights to setup for FPC/JEDI-SDL alone, as the parameters shown in the fields are FPC parameters.

Darkhog
04-05-2009, 08:31 PM
I have a problem. When I run sample programs I get terminal window, and i can type in it (Nothing SDL Window is showing) in directory where I unpacked it I have sdlinput.pas.patch file, and I am sure that is something to do with it. I tried using patch command line tool, but this not works. In --verbose mode on request

patch sdlinput.pas sdlinput.pas.patch I got:
Hmm... I can't seem to find a patch in there anywhere.

How can I fix that?

WILL
05-05-2009, 09:59 PM
This is not a JEDI-SDL problem it's just the way that all FPC programs and Delphi console programs will execute unless you tell the compiler to specify this to the OS.

Try this code at the top of your main program source.

{$IFDEF Win32}
{$IFDEF FPC}
{$APPTYPE GUI} // FreePascal/Lazarus
{$ELSE}
{$APPTYPE CONSOLE} // Delphi
{$ENDIF}
{$ENDIF}

This will work for both Delphi and FPC/Lazarus programs. :)

Darkhog
05-05-2009, 10:08 PM
But even sdl window doesn't come up.

T-Bear
24-06-2011, 10:43 AM
Hi, i have installed SDL as you said, and the first time i ran it, it worked just fine, but now i get this errormessage when it has compiled: >:( :(
"This application has failed to start because SDL.dll was not found. Re-installing the application may fix this problem."
Can anyone please help me with this? Thnx! ;D
I use lazarus V. 0.9.30

cairnswm
24-06-2011, 10:52 AM
Copy the SDL dll files to the same directory as your .exe

T-Bear
24-06-2011, 12:11 PM
I can't find the file "SDL.dll", and it worked after i installed it, but then i made a new project, and now i get that error. :( Why does it need that dll now, when it didn't need it before.

cairnswm
24-06-2011, 01:39 PM
You cannot run a SDL application without having the SDL.dll library either in the exe directory or in your windows\system directory. The previous project might already have the relevant DLL in the same directory as the project that you were running (or did not use SDL).

You should be able to find SDL.dll wihtout much problem on the internet (and as far as I can remember the dlls are included in the JEDI-SDL downloads)

Stoney
24-06-2011, 01:43 PM
You always need the SDL libraries either in the same path of the application or in the system path. I bundled the latest SDL and SDL friend libraries here: https://github.com/freezedev/elysion/wiki/WinLibraries.zip

Edit: I was a bit too slow. cairnswm beat me to it. :)