Need help compiling for Mac OSX

I recently wrote an application, using SDL as the GUI library, for the math
department where I work. Compiling a statically linked version for Linux
users was no problem (not all faculty using Linux have SDL installed). For
Windows I just include SDL.dll with the executable program, so it need not be
statically linked.

The problem I’m having is that at least two faculty members (including the
department chair) use Macs. I cross compile for Windows using cross-tools,
but how can I cross compile on Linux to create a statically linked executable
program for OSX? I’m assuming that OSX does not have the equivalent of
Window’s dlls (is this true?). Cross compiling would be the ideal solution
for me.

Today I borrowed a Mac so I might be able to compile natively. Downloading and
installing SDL – no problem. However, Macs don’t come with gcc installed. To
use gcc on OSX it seems I need xcode installed. Fine. Went to Apple’s
developers’ website and found out I have to register as an Apple developer to
get gcc. (Is that legal? gcc is GPL, seems to me they can’t legally put
restrictions like that on it.) But what the heck, I filled out all the
entries in the form and clicked “submit” only to be informed that my faculty
email address
was already in use! I guaran-f’ing-t that no one else uses
my faculty email address! WTF is with that? Why would Apple require one to
fill in all that info and then LIE about why they won’t accept one’s
submission? Granted, we all know Steve Jobs is a control freak, but what’s
the point of that kind of nonsense?

So, the condundrum I face is how to produce an executable program for OSX,
both ppc and Intel versions.

If anyone knows how to cross compile on Linux, as I mentioned, that would be
the best solution. If that can’t be done, perhaps someone with a MAC might
volunteer to compile the binaries for me (think of the students!).

Many thanks if you can help out,
Jeff

Why don’t you just use the developer tools CD that comes with every Mac?On Tue, Feb 8, 2011 at 5:35 AM, Jeff Post <j_post at pacbell.net> wrote:

I recently wrote an application, using SDL as the GUI library, for the math
department where I work. Compiling a statically linked version for Linux
users was no problem (not all faculty using Linux have SDL installed). For
Windows I just include SDL.dll with the executable program, so it need not
be
statically linked.

The problem I’m having is that at least two faculty members (including the
department chair) use Macs. I cross compile for Windows using cross-tools,
but how can I cross compile on Linux to create a statically linked
executable
program for OSX? I’m assuming that OSX does not have the equivalent of
Window’s dlls (is this true?). Cross compiling would be the ideal solution
for me.

Today I borrowed a Mac so I might be able to compile natively. Downloading
and
installing SDL – no problem. However, Macs don’t come with gcc installed.
To
use gcc on OSX it seems I need xcode installed. Fine. Went to Apple’s
developers’ website and found out I have to register as an Apple developer
to
get gcc. (Is that legal? gcc is GPL, seems to me they can’t legally put
restrictions like that on it.) But what the heck, I filled out all the
entries in the form and clicked “submit” only to be informed that my
faculty
email address
was already in use! I guaran-f’ing-t that no one else uses
my faculty email address! WTF is with that? Why would Apple require one to
fill in all that info and then LIE about why they won’t accept one’s
submission? Granted, we all know Steve Jobs is a control freak, but what’s
the point of that kind of nonsense?

So, the condundrum I face is how to produce an executable program for OSX,
both ppc and Intel versions.

If anyone knows how to cross compile on Linux, as I mentioned, that would
be
the best solution. If that can’t be done, perhaps someone with a MAC might
volunteer to compile the binaries for me (think of the students!).

Many thanks if you can help out,
Jeff


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

Because I borrowed the Mac, I didn’t get anything else with it. I don’t know
that there is a developer tools CD available.

JeffOn Monday 07 February 2011 21:40, Paulo Pinto wrote:

Why don’t you just use the developer tools CD that comes with every Mac?

Why don’t you just use the developer tools CD that comes with every Mac?

I recently wrote an application, using SDL as the GUI library, for
the math
department where I work. Compiling a statically linked version for
Linux
users was no problem (not all faculty using Linux have SDL
installed). For
Windows I just include SDL.dll with the executable program, so it
need not be
statically linked.

The problem I'm having is that at least two faculty members
(including the
department chair) use Macs. I cross compile for Windows using
cross-tools,
but how can I cross compile on Linux to create a statically linked
executable
program for OSX? I'm assuming that OSX does not have the equivalent of
Window's dlls (is this true?). Cross compiling would be the ideal
solution
for me.

OSX has a dll equivalent - .dylib files.

Today I borrowed a Mac so I might be able to compile natively.
Downloading and
installing SDL -- no problem. However, Macs don't come with gcc
installed. To
use gcc on OSX it seems I need xcode installed. Fine. Went to Apple's
developers' website and found out I have to register as an Apple
developer to
get gcc. (Is that legal? gcc is GPL, seems to me they can't
legally put
restrictions like that on it.) But what the heck, I filled out all the
entries in the form and clicked "submit" only to be informed that
my *faculty
email address* was already in use! I guaran-f'ing-t that *no one*
else uses
my faculty email address! WTF is with that? Why would Apple
require one to
fill in all that info and then LIE about why they won't accept one's
submission? Granted, we all know Steve Jobs is a control freak,
but what's
the point of that kind of nonsense?

Get a temporary email address:
http://10minutemail.com/10MinuteMail/index.html

So, the condundrum I face is how to produce an executable program
for OSX,
both ppc and Intel versions.

I have some scripts to build a universal binary on osx. The short story
is you need gcc 3.3 to build ppc and gcc 4.x to build x86.

http://paintown.svn.sourceforge.net/viewvc/paintown/trunk/misc/gcc?revision=1281&view=markupOn 02/07/2011 10:40 PM, Paulo Pinto wrote:

On Tue, Feb 8, 2011 at 5:35 AM, Jeff Post <j_post at pacbell.net <mailto:j_post at pacbell.net>> wrote:

All Macs have two CDs with them.

The operating system itself, and the developer tools CD. That is where you
will find XCode.–
Paulo

On Tue, Feb 8, 2011 at 7:01 AM, Jeff Post <j_post at pacbell.net> wrote:

On Monday 07 February 2011 21:40, Paulo Pinto wrote:

Why don’t you just use the developer tools CD that comes with every Mac?

Because I borrowed the Mac, I didn’t get anything else with it. I don’t
know
that there is a developer tools CD available.

Jeff


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

I’m assuming that OSX does not have the equivalent of
Window’s dlls (is this true?).

False. RTFM. We provide an official framework (a dynamic library that
conveniently includes its public header files) for Mac which supports
PowerPC, i386, x86_64 for 10.4-10.6 found here:
http://www.libsdl.org/release/SDL-1.2.14.dmg

It includes documentation on how to get started.

Plus we include a developer-extras package found here:
http://www.libsdl.org/release/SDL-devel-1.2.14-extras.dmg

More documentation is inside. It contains an Xcode template so you can
get a project going in a single step.

And if that’s not enough, I have videos on how to use frameworks and
Xcode on OS X. They are for OpenSceneGraph and not SDL, but its the
same concept but simpler with SDL (i.e. no plugins).

http://playcontrol.net/ewing/screencasts/how_to_install_openscenegra.html
http://playcontrol.net/ewing/screencasts/how_to_install_openscenegra_2.html
http://playcontrol.net/ewing/screencasts/create_your_first_openscene.html
http://playcontrol.net/ewing/screencasts/how_to_build_from_the_comma.html
http://playcontrol.net/ewing/screencasts/how_to_create_an_app_bundle.html

Thanks. I’ll check that out. I’m still new at OSX programming.

JeffOn Monday 07 February 2011 22:08, jon wrote:

I'm assuming that OSX does not have the equivalent

of Window’s dlls (is this true?).

OSX has a dll equivalent - .dylib files.

I have some scripts to build a universal binary on osx. The short story
is you need gcc 3.3 to build ppc and gcc 4.x to build x86.

http://paintown.svn.sourceforge.net/viewvc/paintown/trunk/misc/gcc?revision
=1281&view=markup

http://www.libsdl.org/release/SDL-1.2.14.dmg
http://www.libsdl.org/release/SDL-devel-1.2.14-extras.dmg

Yep, I had downloaded both of those and installed them. But I still don’t have
gcc on the machine.

http://playcontrol.net/ewing/screencasts/how_to_install_openscenegra.html
http://playcontrol.net/ewing/screencasts/how_to_install_openscenegra_2.html
http://playcontrol.net/ewing/screencasts/create_your_first_openscene.html
http://playcontrol.net/ewing/screencasts/how_to_build_from_the_comma.html
http://playcontrol.net/ewing/screencasts/how_to_create_an_app_bundle.html

Thank you. I’ll take a look at those in the morning.

JeffOn Monday 07 February 2011 23:08, Eric Wing wrote:

Today I borrowed a Mac so I might be able to compile natively. Downloading
and
installing SDL – no problem. However, Macs don’t come with gcc installed.
To
use gcc on OSX it seems I need xcode installed. Fine. Went to Apple’s
developers’ website and found out I have to register as an Apple developer
to
get gcc. (Is that legal? gcc is GPL, seems to me they can’t legally put
restrictions like that on it.) But what the heck, I filled out all the
entries in the form and clicked “submit” only to be informed that my
faculty
email address
was already in use! I guaran-f’ing-t that no one else uses
my faculty email address! WTF is with that? Why would Apple require one to
fill in all that info and then LIE about why they won’t accept one’s
submission? Granted, we all know Steve Jobs is a control freak, but what’s
the point of that kind of nonsense?

Have an iTunes account using that email address?

If so, just log in to the developer web site using that username/password.

There probably is someone using that email. You.

-MattOn Mon, Feb 7, 2011 at 8:35 PM, Jeff Post <j_post at pacbell.net> wrote:

Have an iTunes account using that email address?

No. I would not use my faculty email for personal accounts.

If so, just log in to the developer web site using that username/password.

Why, in any rational universe, would a company link email accounts for
personal stuff like iTunes to professional stuff like developer accounts? Oh
wait…Apple is run by Steve Jobs isn’t it? Nevermind…

JeffOn Tuesday 08 February 2011 23:25, Matthew Kuiken wrote:

I don’t understand your complaint.

This is a standard business practice. Microsoft does the same thing.

You need an hotmail account to be able to use Microsoft developer services.

This LiveId as it is called, is used in several Microsoft tools.

Similar thing is done by other commercial vendors.–
Paulo

On Wed, Feb 9, 2011 at 10:05 AM, Jeff Post <j_post at pacbell.net> wrote:

On Tuesday 08 February 2011 23:25, Matthew Kuiken wrote:

Have an iTunes account using that email address?

No. I would not use my faculty email for personal accounts.

If so, just log in to the developer web site using that
username/password.

Why, in any rational universe, would a company link email accounts for
personal stuff like iTunes to professional stuff like developer accounts?
Oh
wait…Apple is run by Steve Jobs isn’t it? Nevermind…

Jeff


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

It is apparent that you prefer paying big $$$$$$$ for professional big
versions of Visual Studio.
For 1000$ i’ll download any xcode version you like :slight_smile:

can we move the topic from os flamewars (that are so old fashion) to
trying to fix your problems?
Eric posted some very good links, here are some more general ones



http://gpwiki.org/index.php/SDL:Tutorials:Setup

bye
VittorioOn Wed, Feb 9, 2011 at 10:05 AM, Jeff Post <j_post at pacbell.net> wrote:

On Tuesday 08 February 2011 23:25, Matthew Kuiken wrote:

Have an iTunes account using that email address?

No. I would not use my faculty email for personal accounts.

If so, just log in to the developer web site using that username/password.

Why, in any rational universe, would a company link email accounts for
personal stuff like iTunes to professional stuff like developer accounts? Oh
wait…Apple is run by Steve Jobs isn’t it? Nevermind…

Jeff


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

It is apparent that you prefer paying big $$$$$$$ for professional big
versions of Visual Studio.

I don’t use Visual Studio because I don’t use Windows. I use Linux.

can we move the topic from os flamewars (that are so old fashion) to
trying to fix your problems?

It wasn’t meant to be an OS flamewar. My comments were about the way Apple
does business, which has nothing to do with their OS. (Don’t even get me
started on Sony’s business model, my thoughts on that topic include some very
inappropriate words :wink:

Eric posted some very good links, here are some more general ones
http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/
http://thomas1111.wordpress.com/2010/01/18/installing-xcode-and-using-gcc-o
n-mac/ http://gpwiki.org/index.php/SDL:Tutorials:Setup

Thanks, I appreciate it. I’ll check those out when time permits.

I’m pretty sure I made it obvious that I know next to nothing about Mac OSX.
In particular, does it have an equivalent of Window’s dll libraries? Thanks
to Jon I know that it does, they’re dylib files. So the second best solution
for me (the first being can I cross compile on Linux to create a statically
linked binary for OSX) may be if someone can provide a dylib equivalent of
SDL.dll. That way I don’t have to statically link, but I still need to cross
compile my app.

For reference, I’m using SDL v1.2.9. Some of the reusable code I’ve written
worked fine up until 1.2.9, after that it was broken by some changes in SDL
that I’ve never had time to investigate. So if anyone can provide a dylib
file, please make it compatible with 1.2.9.

In the meantime, I’m still looking for a way I can cross compile on Linux for
OSX. With my work schedule, and having to deal with some matters of personal
urgency, I’ve little time to do research. That’s why I asked for help.

Thanks to everyone who’s provided useful feedback,
JeffOn Wednesday 09 February 2011 15:23, Vittorio G. wrote:

Hello,

It is apparent that you prefer paying big $$$$$$$ for professional big
versions of Visual Studio.

I don’t use Visual Studio because I don’t use Windows. I use Linux.

can we move the topic from os flamewars (that are so old fashion) to
trying to fix your problems?

It wasn’t meant to be an OS flamewar. My comments were about the way Apple
does business, which has nothing to do with their OS. (Don’t even get me
started on Sony’s business model, my thoughts on that topic include some very
inappropriate words :wink:

Eric posted some very good links, here are some more general ones
http://www.tech-recipes.com/rx/726/mac-os-x-install-gcc-compiler/
http://thomas1111.wordpress.com/2010/01/18/installing-xcode-and-using-gcc-o
n-mac/ http://gpwiki.org/index.php/SDL:Tutorials:Setup

Thanks, I appreciate it. I’ll check those out when time permits.

I’m pretty sure I made it obvious that I know next to nothing about Mac OSX.
In particular, does it have an equivalent of Window’s dll libraries? Thanks
to Jon I know that it does, they’re dylib files. So the second best solution
for me (the first being can I cross compile on Linux to create a statically
linked binary for OSX) may be if someone can provide a dylib equivalent of
SDL.dll. That way I don’t have to statically link, but I still need to cross
compile my app.

For reference, I’m using SDL v1.2.9. Some of the reusable code I’ve written
worked fine up until 1.2.9, after that it was broken by some changes in SDL
that I’ve never had time to investigate. So if anyone can provide a dylib
file, please make it compatible with 1.2.9.

In the meantime, I’m still looking for a way I can cross compile on Linux for
OSX. With my work schedule, and having to deal with some matters of personal
urgency, I’ve little time to do research. That’s why I asked for help.

Linux object format: ELF
Mac OS X object format: Mach-O

Google search (mach-o linux) returned nothing interesting, except this:

http://www.agner.org/optimize/objconv.zip
http://www.agner.org/optimize/objconv-instructions.pdf

IMHO, it would be much easier to use Xcode…

Regards,

Rapha?lOn Feb 10, 2011, at 4:23 AM, Jeff Post wrote:

On Wednesday 09 February 2011 15:23, Vittorio G. wrote:

Thanks to everyone who’s provided useful feedback,
Jeff


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