Compiling SDL 1.3 in XCode (Mac OS X Leo)

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using XCode ?

Thanks.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !> I cannot compile the latest revision of version 1.3 on Mac.

Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?

I will try, but what about missing files ?
Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.> Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a??
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using??
XCode ?

i found that you can fix the missing-file-error by adding
SDL_power.h : from the “project” menu, choose “add to project” and the
choosing SDL_power.h from the “include” directory in the root of the
downloaded SDL folder

then I get a zero-error comiled framework… with which I have no
clue what to do :-)> I will try, but what about missing files ?

Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks. I’ll give it a try when i am at home.> i found that you can fix the missing-file-error by adding??

SDL_power.h : from the “project” menu, choose “add to project” and the??
choosing SDL_power.h from the “include” directory in the root of the??
downloaded SDL folder

then I get a zero-error comiled framework… with which I have no??
clue what to do :slight_smile:

I will try, but what about missing files ?
Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

my biggest question is now : “now what ?” how do i get SDL_image,
SDL_ttf and SDL_mixer running with this ? Is there some template
project somewhere that includes these ?On 30 Jul 2009, at 11:36, daniel at corefault.de wrote:

Thanks. I’ll give it a try when i am at home.

i found that you can fix the missing-file-error by adding
SDL_power.h : from the “project” menu, choose “add to project” and
the
choosing SDL_power.h from the “include” directory in the root of the
downloaded SDL folder

then I get a zero-error comiled framework… with which I have no
clue what to do :slight_smile:

I will try, but what about missing files ?
Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I have seen in another thread that due to a changed sdl_surface additional libraries should be recompiled.
I have the same problem and will try to build the additional libraries from scratch.> ----- Original Message -----

From: jeroen.clarysse@telenet.be
To: sdl at lists.libsdl.org
Date: 30.07.2009 11:40:09
Subject: Re: [SDL] Compiling SDL 1.3 in XCode (Mac OS X Leo)

my biggest question is now : “now what ?” how do i get SDL_image,??
SDL_ttf and SDL_mixer running with this ? Is there some template??
project somewhere that includes these ?

On 30 Jul 2009, at 11:36, @daniel_at_corefault wrote:

Thanks. I’ll give it a try when i am at home.

i found that you can fix the missing-file-error by adding
SDL_power.h : from the “project” menu, choose “add to project” and??
the
choosing SDL_power.h from the “include” directory in the root of the
downloaded SDL folder

then I get a zero-error comiled framework… with which I have no
clue what to do :slight_smile:

I will try, but what about missing files ?
Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’m doing that now : if you download SDL_image from the trunk :

svn checkout http://svn.libsdl.org/trunk/SDL_image

there’s an XCode.tar.gz. Unzipping gives you an Xcode directory with a
project file. Opening and building goes reasonably well, but there are
4 linker-errors now, referencing missing links IMG_Load_CUR_RW… I’m
trying to find out where these functions are locatedOn 30 Jul 2009, at 11:58, daniel at corefault.de wrote:

I have seen in another thread that due to a changed sdl_surface
additional libraries should be recompiled.
I have the same problem and will try to build the additional
libraries from scratch.

----- Original Message -----
From: @Jeroen_Clarysse
To: sdl at lists.libsdl.org
Date: 30.07.2009 11:40:09
Subject: Re: [SDL] Compiling SDL 1.3 in XCode (Mac OS X Leo)

my biggest question is now : “now what ?” how do i get SDL_image,
SDL_ttf and SDL_mixer running with this ? Is there some template
project somewhere that includes these ?

On 30 Jul 2009, at 11:36, daniel at corefault.de wrote:

Thanks. I’ll give it a try when i am at home.

i found that you can fix the missing-file-error by adding
SDL_power.h : from the “project” menu, choose “add to project” and
the
choosing SDL_power.h from the “include” directory in the root of
the
downloaded SDL folder

then I get a zero-error comiled framework… with which I have no
clue what to do :slight_smile:

I will try, but what about missing files ?
Should not compile on any platform or am i wrong ?
The missing SDL_revision.h can simply be generated (just a
define).
I try to compile on different platforms to get more details.

If anyone succeeded in compiling in XCode please tell.

Daniel,

if you manage to get XCode-SDL compiled, would you mind writing a
short how-to ? I’m struggling with the same problems !

I cannot compile the latest revision of version 1.3 on Mac.
Compiling in XCode throws a lot of error messages.
Seems that sdl_revision.h is missing and gcc-3.3 problems occur.
Should I make some pre-configurations ?
Is there a revision which compiles without problems on Mac using
XCode ?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

okay, i managed to get SDL_image compiled : the code for cursor and
icon testing & loading seems to be missing in IMG_imageIO.c (which I
think is the only file that the MacOS version needs… correct me if
i’m wrong but I think this is simply an SDL wrapper around CoreImage )

so I copied the four missing functions from the SECOND part of bmp.c,
and pasted them in IMG_imageIO.c.

make sure you copy the implementations that return 0 and NULL, or you
will have other linker problems

So my SDLimage is compiled now, but how will I know if I have linked
it to the proper version of SDL ???

ALMOST there !

a short walk-trhough on what I did :

  • download SDL from svn : in terminal change directory to wherever
    you’re going to build SDL, and type

      svn checkout http://svn.libsdl.org/trunk/SDL
    
  • the resulting directory will contain a subdir named XCode, which has
    a project file SDL.xcodeproj. Open that one

  • you will need to add three files to the project : SDL_power.h &
    SDL_atomic which already exist, and a new file SDL_revsion.h, which
    does NOT yet exist. That last file should simply contain one define
    statement that holds the current SDL version :

    #define SDL_REVISION 4567

  • add these files by chosing “add to project” from the “project” menu

  • make sure you mark the checkbox in front of the framework target, or
    the files will NOT be copied to your compiled framework

  • you’ll have to tell the project that these two files are PUBLIC, and
    need to be copied to the exported headers :

    • in the left column, inside the “targets” subtree, select “framework”.
    • The main pane of the project window should show the details of the
      target. If not, click “details” on top
    • look for sDL_power.h, and make sure the 2nd column “role” is set to
      "public" rather than “project”
    • repeat for SDL_atomic.h
    • repeat for SDL_revision.h
  • make sure you’ve set the deployment target if that’s what you want

  • compile

  • when done, the XCode folder will contain a “build” folder, in which
    you’ll find a subfolder “deployment” or “development” folder,
    depending on which target you’ve set

  • inside the deply/develop folder, there will be a SDL.Framework folder.

  • Drag that folder to /Library/Frameworks

now we need to add SDL_image. Get it from subvrsion :

svn checkout http://svn.libsdl.org/trunk/SDL_image
  • again, there’s an xcode folder, but it is still zipped. Unzip it and
    open the project file
  • try to compile. You’ll get some link errors because 4 functions
    defined in bmp.c need to be copied to IMG_imageio.c. Make sure your
    copy the functions that return 0 and NULL
  • compile again. should be fine now
  • you’ll have a build folder now inside the SDL_image/XCode folder.
  • Inside that build folder should be a deply/develop folder, which
    contains SDL_image.framework
  • copy that SDL_image.framework folder to /Library/Frameworks

now we’re going to test it : inside the SDL_image/XCode folder, you’ll
find a folder named ShowImage, which contains another XCode project.
Open it and try to compile…

this is where I’m stuck :-((( i get a link error complaining about a
duplicate definition for _main

here’s my final walkthrough after 2 hours of sweat :

ALMOST there !

a short walk-trhough on what I did :

  • download SDL from svn : in terminal change directory to wherever
    you’re going to build SDL, and type

      svn checkout http://svn.libsdl.org/trunk/SDL
    
  • the resulting directory will contain a subdir named XCode, which has
    a project file SDL.xcodeproj. Open that one

  • you will need to add three files to the project : SDL_power.h &
    SDL_atomic which already exist, and a new file SDL_revsion.h, which
    does NOT yet exist. That last file should simply contain one define
    statement that holds the current SDL version :

    #define SDL_REVISION 4567

  • add these files by chosing “add to project” from the “project” menu

  • make sure you mark the checkbox in front of the framework target, or
    the files will NOT be copied to your compiled framework

  • you’ll have to tell the project that these two files are PUBLIC, and
    need to be copied to the exported headers :

    • in the left column, inside the “targets” subtree, select “framework”.
    • The main pane of the project window should show the details of the
      target. If not, click “details” on top
    • look for sDL_power.h, and make sure the 2nd column “role” is set to
      "public" rather than “project”
    • repeat for SDL_atomic.h
    • repeat for SDL_revision.h
  • fix a bug in SDL_main.h : inside the SDL folder, there’s a subfolder
    "include", with a file named SDL_main.h

  • open that file

  • the #if statement on line 30 is incomplete in SDL 1.3 ! Somehow the
    Mac part is missing. It should look like this :
    #if defined(WIN32) ||
    (defined(MWERKS) && !defined(BEOS)) ||
    defined(MACOS) || defined(MACOSX) ||
    defined(SYMBIAN32) || defined(QWS)

  • change it & save it

  • make sure you’ve set the deployment target if that’s what you want

  • compile

  • when done, the XCode folder will contain a “build” folder, in which
    you’ll find a subfolder “deployment” or “development” folder,
    depending on which target you’ve set

  • inside the deply/develop folder, there will be a SDL.Framework folder.

  • Drag that folder to /Library/Frameworks

now we need to add SDL_image. Get it from subvrsion :

svn checkout http://svn.libsdl.org/trunk/SDL_image
  • again, there’s an xcode folder, but it is still zipped. Unzip it and
    open the project file
  • try to compile. You’ll get some link errors because 4 functions
    defined in bmp.c need to be copied to IMG_imageio.c. Make sure your
    copy the functions that return 0 and NULL
  • compile again. should be fine now
  • you’ll have a build folder now inside the SDL_image/XCode folder.
  • Inside that build folder should be a deply/develop folder, which
    contains SDL_image.framework
  • copy that SDL_image.framework folder to /Library/Frameworks

now we’re going to test it : inside the SDL_image/XCode folder, you’ll
find a folder named ShowImage, which contains another XCode project.
Open it and try to compile…

should work now… (fingers crossed)

if you have no compile errors, the app should work, but since it is a
command-line application, you’ll have to test it from terminal :

  • open a terminal window
  • drag the app to the terminal window to get the proper path (the app
    is inside the ShowImage/build/deploy folder)
  • type a space inside the terminal window
  • drag a bmp or jpg or other image file to terminal window to add that
    path to the current command
  • hit enter
    -…
  • http://www.instantrimshot.com/

:slight_smile:

Thanks a lot. Great work. I will check it asap.
Perfect.
Hope the version is worth the work.> ----- Original Message -----

From: jeroen.clarysse@telenet.be
To: sdl at lists.libsdl.org
Date: 30.07.2009 14:09:58
Subject: [SDL] Finally : got SDL 1.3 compiled on MacOS X. Here is a walkthrough

here’s my final walkthrough after 2 hours of sweat :

ALMOST there !

a short walk-trhough on what I did :

  • download SDL from svn??:??in terminal change directory to wherever??
    you’re going to build SDL, and type

     svn checkout http://svn.libsdl.org/trunk/SDL
    
  • the resulting directory will contain a subdir named XCode, which has??
    a project file SDL.xcodeproj. Open that one

  • you will need to add three files to the project : SDL_power.h &??
    SDL_atomic which already exist, and a new file SDL_revsion.h, which??
    does NOT yet exist. That last file should simply contain one define??
    statement that holds the current SDL version :

    #define SDL_REVISION 4567

  • add these files by chosing “add to project” from the “project” menu

  • make sure you mark the checkbox in front of the framework target, or??
    the files will NOT be copied to your compiled framework

  • you’ll have to tell the project that these two files are PUBLIC, and??
    need to be copied to the exported headers :

    • in the left column, inside the “targets” subtree, select “framework”.
    • The main pane of the project window should show the details of the??
      target. If not, click “details” on top
    • look for sDL_power.h, and make sure the 2nd column “role” is set to??
      “public” rather than “project”
    • repeat for SDL_atomic.h
    • repeat for SDL_revision.h
  • fix a bug in SDL_main.h : inside the SDL folder, there’s a subfolder??
    “include”, with a file named SDL_main.h

  • open that file

  • the #if statement on line 30 is incomplete in SDL 1.3 ! Somehow the??
    Mac part is missing. It should look like this :
    #if defined(WIN32) ||
    ??? (defined(MWERKS) && !defined(BEOS)) ||
    ??? defined(MACOS) || defined(MACOSX) ||
    ??? defined(SYMBIAN32) || defined(QWS)

  • change it & save it

  • make sure you’ve set the deployment target if that’s what you want

  • compile

  • when done, the XCode folder will contain a “build” folder, in which??
    you’ll find a subfolder “deployment” or “development” folder,??
    depending on which target you’ve set

  • inside the deply/develop folder, there will be a SDL.Framework folder.

  • Drag that folder to /Library/Frameworks

now we need to add SDL_image. Get it from subvrsion :

svn checkout http://svn.libsdl.org/trunk/SDL_image
  • again, there’s an xcode folder, but it is still zipped. Unzip it and??
    open the project file
  • try to compile. You’ll get some link errors because 4 functions??
    defined in bmp.c need to be copied to IMG_imageio.c. Make sure your??
    copy the functions that return 0 and NULL
  • compile again. should be fine now
  • you’ll have a build folder now inside the SDL_image/XCode folder.
  • Inside that build folder should be a deply/develop folder, which??
    contains SDL_image.framework
  • copy that SDL_image.framework folder to /Library/Frameworks

now we’re going to test it : inside the SDL_image/XCode folder, you’ll??
find a folder named ShowImage, which contains another XCode project.??
Open it and try to compile…

should work now… (fingers crossed)

if you have no compile errors, the app should work, but since it is a??
command-line application, you’ll have to test it from terminal :

  • open a terminal window
  • drag the app to the terminal window to get the proper path (the app??
    is inside the ShowImage/build/deploy folder)
  • type a space inside the terminal window
  • drag a bmp or jpg or other image file to terminal window to add that??
    path to the current command
  • hit enter
    -…
  • http://www.instantrimshot.com/

:slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hope the version is worth the work.

hope so… mostly hope 2 things :

  • someone merges these bugs into the trunk
  • multimonitor works
  • hardware acceleration works (hard to test this one !)

that was 3 things actually :-))))))On 30 Jul 2009, at 14:56, jeroen clarysse wrote:

Hope the version is worth the work.

hope so… mostly hope 2 things :

  • someone merges these bugs into the trunk
  • multimonitor works
  • hardware acceleration works (hard to test this one !)

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thanks for writing this up!

I added SDL_atomic.h, SDL_power.h and SDL_revision.h to the public headers,
as well as added the atomic API source files. They don’t compile yet, but
they should go into the project.

SDL 1.3 doesn’t need SDL_main() anymore, so that was intentionally left
out. Were you running into issues because that was missing?

I also updated SDL_image with the ICO and CUR file formats, though I suspect
the CUR loader doesn’t work.

See ya!On Thu, Jul 30, 2009 at 5:09 AM, jeroen clarysse <jeroen.clarysse at telenet.be wrote:

here’s my final walkthrough after 2 hours of sweat :

ALMOST there !

a short walk-trhough on what I did :

  • download SDL from svn : in terminal change directory to wherever you’re
    going to build SDL, and type

             svn checkout http://svn.libsdl.org/trunk/SDL
    
  • the resulting directory will contain a subdir named XCode, which has a
    project file SDL.xcodeproj. Open that one

  • you will need to add three files to the project : SDL_power.h &
    SDL_atomic which already exist, and a new file SDL_revsion.h, which does NOT
    yet exist. That last file should simply contain one define statement that
    holds the current SDL version :

     #define SDL_REVISION 4567
    
  • add these files by chosing “add to project” from the “project” menu

  • make sure you mark the checkbox in front of the framework target, or the
    files will NOT be copied to your compiled framework

  • you’ll have to tell the project that these two files are PUBLIC, and need
    to be copied to the exported headers :
    * in the left column, inside the “targets” subtree, select
    "framework".
    * The main pane of the project window should show the details of the
    target. If not, click “details” on top
    * look for sDL_power.h, and make sure the 2nd column “role” is set
    to “public” rather than “project”
    * repeat for SDL_atomic.h
    * repeat for SDL_revision.h

  • fix a bug in SDL_main.h : inside the SDL folder, there’s a subfolder
    "include", with a file named SDL_main.h

  • open that file

  • the #if statement on line 30 is incomplete in SDL 1.3 ! Somehow the Mac
    part is missing. It should look like this :
    #if defined(WIN32) ||
    (defined(MWERKS) && !defined(BEOS)) ||
    defined(MACOS) || defined(MACOSX) ||
    defined(SYMBIAN32) || defined(QWS)

  • change it & save it

  • make sure you’ve set the deployment target if that’s what you want

  • compile

  • when done, the XCode folder will contain a “build” folder, in which
    you’ll find a subfolder “deployment” or “development” folder, depending on
    which target you’ve set

  • inside the deply/develop folder, there will be a SDL.Framework folder.

  • Drag that folder to /Library/Frameworks

now we need to add SDL_image. Get it from subvrsion :

   svn checkout http://svn.libsdl.org/trunk/SDL_image
  • again, there’s an xcode folder, but it is still zipped. Unzip it and open
    the project file
  • try to compile. You’ll get some link errors because 4 functions defined
    in bmp.c need to be copied to IMG_imageio.c. Make sure your copy the
    functions that return 0 and NULL
  • compile again. should be fine now
  • you’ll have a build folder now inside the SDL_image/XCode folder.
  • Inside that build folder should be a deply/develop folder, which contains
    SDL_image.framework
  • copy that SDL_image.framework folder to /Library/Frameworks

now we’re going to test it : inside the SDL_image/XCode folder, you’ll find
a folder named ShowImage, which contains another XCode project. Open it and
try to compile…

should work now… (fingers crossed)

if you have no compile errors, the app should work, but since it is a
command-line application, you’ll have to test it from terminal :

  • open a terminal window
  • drag the app to the terminal window to get the proper path (the app is
    inside the ShowImage/build/deploy folder)
  • type a space inside the terminal window
  • drag a bmp or jpg or other image file to terminal window to add that path
    to the current command
  • hit enter
    -…
  • http://www.instantrimshot.com/

:slight_smile:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC