Results 1 to 6 of 6

Thread: Lazarus FreePascal and SDL on Ubuntu...

  1. #1

    Lazarus FreePascal and SDL on Ubuntu...

    Hi all,
    Is anyone where using UBuntu with Lazarus, FreePascal and JEDI-SDL?
    In the past when I have compiled stuff it it was a simple case of
    Code:
    fpc -Sd Myproject.dpr
    and it would just work assuming I have everything set up.

    With Ubuntu I'm trying to compile a Mac OS X app over to Linux and include some LCL code to boot. I'm using the following command line...

    Code:
    fpc YoYo70.lpr -S2d -OG1  -k-lSDL -k-lSDL_mixer -ve -Fl/usr/lib/ -Fu/usr/share/lazarus/lcl/units/i386-linux/ -Fu/usr/share/lazarus/lcl/units/i386-linux/gtk/ -Fu/usr/share/lazarus/packager/units/i386-linux/ -Fu. -FUobjs/ -dLCL -dLCLgtk
    Everything compiles, but at the linking stage I'm getting the following error

    Code:
    Linking YoYo70
    /usr/bin/ld: cannot find -lSDLMain
    YoYo70.lpr(137,1) Error: Error while linking
    Any ideas?

    This was working yesterday, but the moment I updated the project's source files it started throwing this error.
    I've never had this -lSDLMain error before on Linux.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #2

    Lazarus FreePascal and SDL on Ubuntu...

    Dom

    I've just compiled a JEDI-SDL app on my Virtual Ubuntu with no problems at all. Try leaving out the -k options.

    Dean
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  3. #3

    Lazarus FreePascal and SDL on Ubuntu...

    Which SDL are you using? The one in FPC (2.2.0+) is perfectly working without any of the voodoo stuff you're doing eg:

    Code:
    program x;
    
    uses
      SDL, SDL_Image, SDL_Mixer, SDL_ttf;
    
    begin
    // whatever
    end.
    Compiles simply with:

    fpc -O2 -XX -Xs ./program.pas

    (I included "release class" switches but fpc ./program.pas would work just as well).

    Specifying link paths is simply not required. AFAIK JEDI-SDL included our changes eventually too so theirs should work just as well (just specify paths to the .pas files if you use 3rd party one).
    Feel the power of Open Source.
    <br />Feel the power of Free Pascal.

  4. #4

    Lazarus FreePascal and SDL on Ubuntu...

    Hi Guys,
    I just realised what is causing the problem. Due to cross compilation under Mac OS X, I have a {$LINKLIB SDLMain} statment which was causing the error message mentioned earlier.

    So my next question is I have a IFDEF UNIX around this code because Mac OS X is Unix, but how can I then differentiate between the various flavours of Unix in my if def? Can I IFDEF Linux or IFDEF MacOS?

    Thanks.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  5. #5

    Lazarus FreePascal and SDL on Ubuntu...

    you need

    [pascal]{$IFDEF DARWIN}[/pascal]

    for Macosx and

    [pascal]{$IFDEF LINUX}[/pascal]

    linux base platforms.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  6. #6

    Lazarus FreePascal and SDL on Ubuntu...

    Thanks Dean, that should sort out the malaise.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •