The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL 1.2 on Mac OS X El Capitan
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
Hello,

I am new here but expect to be coming back a lot. I support some programs that still are using SDL 1.2. They also use a sprite engine caleld Kyra (anyone familiar with it ?) which also uses SDL.

Our prgrams are in need of updating for sure.

Since El Capitan our programs crash rigth away and the crash reports show that the crash occurs in SDL_FillRect in one of the programs:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libSDL-1.2.0.dylib 0x000ee1bd SDL_FillRect + 530


..... and in the other it is not apparant to me where exactly (???):

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 ??? 0x0023da1e DYLD-STUB$$memcpy + 0
1 newcmj 0x001533a7 KrRle::Draw(KrPaintInfo*, KrMatrix2 const&, KrColorTransform const&, KrRect const&, int) + 1165
2 newcmj 0x001608f0 KrAction::Draw(KrPaintInfo*, int, KrMatrix2 const&, KrColorTransform const&, KrRect const&, int) + 98
3 newcmj 0x001544b0 KrSprite::Draw(KrPaintInfo*, KrRect const&, int) + 96
4 newcmj 0x00149667 KrImageTree::DrawWalk(KrRect const&, KrImNode*, KrPaintInfo*, int) + 439
5 newcmj 0x00149596 KrImageTree::DrawWalk(KrRect const&, KrImNode*, KrPaintInfo*, int) + 230
6 newcmj 0x00149596 KrImageTree::DrawWalk(KrRect const&, KrImNode*, KrPaintInfo*, int) + 230
7 newcmj 0x0014975c KrImageTree::DrawWalk(KrRect const&, KrPaintInfo*, int) + 116
8 newcmj 0x00147938 KrEngine::Draw(bool, GlDynArray<KrRect>*) + 658
9 newcmj 0x0004fcc7 CMJBaseClass::Draw() + 97
10 newcmj 0x00068e32 SDL_main + 1592
11 newcmj 0x0016cfc9 -[SDLMain applicationDidFinishLaunching:] + 75


Is there anyone out there with similar issues or advice? I imagine everyone here is not running SDL 1.2 on El Capitan.....


Thanks,
Steve
Dominus


Joined: 13 Oct 2009
Posts: 127
If you built SDL 1.x from current 1.x branch of SDL's mercurial it might work (or you might need to adapt your source).
I'm building Exult against SDL 1.x and it still works in El Capitan.
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
Ok, sounds promising, thank you.....I am trying to do this and have downloaded SDL-453dce726f24.zip.

I cannot find the cofigure file in the SDL-1.2 branch.

Do I grab the one from the default branch SDL-0be86b512d34.zip ?
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
So if I want to build the latest SDL 1.x branch of Mercurial do I :

- click on 'branches
....where I see SDL-1.2
- click on the 'files' link next to the 1.2 branch
- click on 'zip'


The resulting download (SDL-453dce726f24.zip) does not contain the 'configure' file, which is abviosly missing when I try to run the following commands to build SDL:

./configure
make
sudo make install


Would it be missing other files....do the branch files need to be merged with another download?

I apolgize for my ignorance here. I think what I need to do is build static dynamic linking libraries to bundle with the installers of our programs to see if the updated libraries will run on El Capitain.
Dominus


Joined: 13 Oct 2009
Posts: 127
You need to run ./autogen.sh first.

Also depends, if you are making use of the framework, then use xcode to build SDL (through the xcode.project file somewhere).
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
Thank you Dominus...I did that but get :

Couldn't find autoconf, aborting


...looking for this autoconf file
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
...installed Homebrew (http://brew.sh/) to install Autoconf and Automake:

brew install autoconf automake

ran ./autogen.sh....now I am ready to run ./configure


ran ./configure successfully
ran make....got 1 error :


In file included from ./src/events/SDL_events.c:27:
./include/SDL_syswm.h:58:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
^
1 error generated.
make: *** [build/SDL_events.lo] Error 1


..investigating
Dominus


Joined: 13 Oct 2009
Posts: 127
You probably don't need the x11 backend. Disable it via ./configure --without-x
But check via ./configure --help whether I gave you the correct command Wink

Or download and install xqartz and add the path to the xqartz includes.
Or check with brew whether they provide sdl 1.x devel...
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
btw, not using the framework

You were right, ./configure --without-x ran without error!

make.....generated 6 warnings but no errors

'sudo make install' ran successfully, created a build folder

Now I need to get from here to having these two files:


libSDL-1.2.0.dylib
libSDL_mixer-1.2.0.dylib


..I guess now they should be named:

libSDL-1.2.15.dylib
libSDL_mixer-1.2.15.dylib

.....no idea how yet, seeing what I can find....
Dominus


Joined: 13 Oct 2009
Posts: 127
Make install should have put the sdl libs somewhere in your prefix. No idea what that is though with homebrew. /usr/local/libs or somewthing like that.

But sdl_mixer is seperate from the sdl sources, you need to download that from its own repo. For that you can get the last release sources (aimed at sdl 1.x) since that didn't get any relevant fixes, I think.
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
Hey, you are rght, the sdlibs were created in /usr/local/lib.

I tried running our app and it crashed since it coudln't find the libSDL_mixer as you predicted.....now to work on that.

Thank you Dominus
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
The next hurdle is:

Reason: no suitable image found. Did find:
/usr/local/lib/libSDL-1.2.0.dylib: mach-o, but wrong architecture

SDL is architecture: x86_64

...whereas our app is built for ppc and i386


We don't care about pps really but is it easy to build SDL for i386 (maybe I must build it for ppc as well in order for the 'architectures' to match....)?
suhlman


Joined: 09 Dec 2015
Posts: 14
Location: Halifax, Nova Scotia, Canada
Wow, what luck, it worked Dominus!

I built libSDL-1.2.0.dylib for i386 and the libSDL_mixer-1.2.0.dylib as well.

However our program only worked if I used the older libSDL_mixer-1.2.0.dylib and the new libSDL-1.2.0.dylib. But everything seems fine.

Thank you,
Steve
Dominus


Joined: 13 Oct 2009
Posts: 127
Great! Happy to be helpful Smile