SDLmain on Panther

I believe I’ve installed SDL correctly. I do not want
to use XCode for development, since XCode isn’t
available to everyone. I am really against using
anything for development that isn’t already very
popular or at least easy to get. I’ve searched the
internet a LOT for the past two days, and haven’t
found much useful information.

~/$ cat -framework SDL test.c
#include <SDL/SDL.h>
int main(int argc, char **argv)
{
puts(“Yo!”);
return 0;
}
~/$ cc test.c
ld: Undefined symbols:
_main

I didn’t seem to have any of this kind of trouble on
another machine running Panther. I never even heard of
anything call SDLMain and never had a single problem.
Please help me! Thank you!__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

If this email already got sent, I apologize! Yahoopops
is freezing up on my system frequently. I’ve stopped
using it now, though. So this won’t happen again.

I believe I’ve installed SDL correctly. I do not want
to use XCode for development, since XCode isn’t
available to everyone. I am really against using
anything for development that isn’t already very
popular or at least easy to get. I’ve searched the
internet a LOT for the past two days, and haven’t
found much useful information.

~/$ cat -framework SDL test.c
#include <SDL/SDL.h>
int main(int argc, char **argv)
{
puts(“Yo!”);
return 0;
}
~/$ cc test.c
ld: Undefined symbols:
_main

I didn’t seem to have any of this kind of trouble on
another machine running Panther. I never even heard of
anything call SDLMain and never had a single problem.
Please help me! Thank you!__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

Read the FAQ, please!

Bye,

Max

I’m so sorry, I had googled that FAQ page and scrolled
straight to an area that mentioned the "Unix Variant,"
and that is what I spent most of my time searching
for, and didn’t find anything.

I followed the instructions in the FAQ. I went and
downloaded DarwinPorts, I ran sudo port install
libsdl. It installed fine, it seemed. I ran into some
problems, and I had to add some environment variables
in /etc/bashrc:

CPATH=/opt/local/include
LIBRARY_PATH=/opt/local/lib
export CPATH LIBRARY_PATH

This helps GCC find SDL includes and libraries. So
next this happened:

~/$ cc -lSDL -lSDLmain test.c
ld: /opt/local/lib/libSDLmain.a(SDLMain.o) illegal
reference to symbol:
.objc_class_name_NSAppleMenuController defined in
indirectly referenced dynamic library
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
ld: /opt/local/lib/libSDLmain.a(SDLMain.o) illegal
reference to symbol:
.objc_class_name_NSAutoreleasePool defined in
indirectly referenced dynamic library
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
ld: /opt/local/lib/libSDLmain.a(SDLMain.o) illegal
reference to symbol: _CPSEnableForegroundOperation
defined in indirectly referenced dynamic library
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
ld: /usr/lib/crt1.o illegal reference to symbol:
__objcInit defined in indirectly referenced dynamic
library /usr/lib/libobjc.A.dylib

What is an indirect reference? Again, thanks for any
help, and sorry about my ignorance earlier (and now, I
suppose.)

— Max Horn wrote:> Read the FAQ, please!

Bye,

Max


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

I believe I’ve installed SDL correctly. I do not
want
to use XCode for development, since XCode isn’t
available to everyone. I am really against using
anything for development that isn’t already very
popular or at least easy to get. I’ve searched the
internet a LOT for the past two days, and haven’t
found much useful information.

~/$ cat -framework SDL test.c
#include <SDL/SDL.h>
int main(int argc, char **argv)
{
puts(“Yo!”);
return 0;
}
~/$ cc test.c
ld: Undefined symbols:
_main

I didn’t seem to have any of this kind of trouble on
another machine running Panther. I never even heard
of
anything call SDLMain and never had a single
problem.
Please help me! Thank you!

First, you should read the SDL FAQs, especially the
MacOS X FAQ. (OT: You might also note that #include
"SDL.h" is the recommended convention.)
http://www.libsdl.org/faq.php

Second, if you’re using the developer Frameworks from
the SDL download section, you must compile in the
SDLmain.m file with your project. This is not
optional. I don’t remember where it is, but if you
start a new “SDL Application” with the Project Builder
or Xcode templates (installed with the SDL developer
Framework), then it automatically copies a new
SDLmain.m into the new project. Or you could always do
a file search.

If you compiled SDL yourself (might be true for Fink
too), you can bypass the SDLmain.m and link to a
library called libSDLmain.a (-lSDLmain). This already
precompiled SDLmain.m into a library for you.

Finally, concerning Apple’s Developer Tools, they’re
free with the operating system on the last CD, and
they are also available for download directly from
Apple. I don’t know how it could be easier to get than
already having with your operating system CDs. And
before you completely forsake the Xcode tools (it
sounds like you’re running Panther from the message
topic), they have some very nice features available
you might want to consider using. This is not to steer
you away from Makefiles, but you might consider using
both in your development to get the best of both
worlds.

-Eric> From: Donny Viszneki

Thank you for such a lengthy and helpful reply Eric.
Someone has already pointed out to me that I didn’t
read the FAQ very carefully (I only searched it for a
specific keyword, and what I did next isn’t entirely
relevant.)

I’ve already made another reply to the helpful person
who said “Read the faq, bye.” This time concerning the
new problems I’ve encountered. If you think you can
help with that, please, give it a shot.

Perhaps I will look more closely at XCode, but only
because you’ve said it has some useful features. But I
refuse to include it as part of the build process or
use any special code generation that would require
that a person who wants to modify my work have XCode.
Simply put, you may say it’s simple to get XCode, and
it probably is, but it still doesn’t meet my standard
of popularity. I don’t want people to have to download
10 packages if they choose to help develop my
software, and while SDL + XCode only makes 2, who
knows what XCode’s prerequisites are, and if I make it
a policy to incur new prerequisite software on a whim,
then I’ll probably end up with a lot more than anyone
wants to deal with. (Or, perhaps no one else in the
world has my intolerance for dependancy hell :slight_smile: )

Thanks again.

— Eric Wing wrote:> > From: Donny Viszneki

I believe I’ve installed SDL correctly. I do not
want
to use XCode for development, since XCode isn’t
available to everyone. I am really against using
anything for development that isn’t already very
popular or at least easy to get. I’ve searched the
internet a LOT for the past two days, and
haven’t
found much useful information.

~/$ cat -framework SDL test.c
#include <SDL/SDL.h>
int main(int argc, char **argv)
{
puts(“Yo!”);
return 0;
}
~/$ cc test.c
ld: Undefined symbols:
_main

I didn’t seem to have any of this kind of trouble
on
another machine running Panther. I never even
heard
of
anything call SDLMain and never had a single
problem.
Please help me! Thank you!

First, you should read the SDL FAQs, especially the
MacOS X FAQ. (OT: You might also note that #include
"SDL.h" is the recommended convention.)
http://www.libsdl.org/faq.php

Second, if you’re using the developer Frameworks
from
the SDL download section, you must compile in the
SDLmain.m file with your project. This is not
optional. I don’t remember where it is, but if you
start a new “SDL Application” with the Project
Builder
or Xcode templates (installed with the SDL developer
Framework), then it automatically copies a new
SDLmain.m into the new project. Or you could always
do
a file search.

If you compiled SDL yourself (might be true for Fink
too), you can bypass the SDLmain.m and link to a
library called libSDLmain.a (-lSDLmain). This
already
precompiled SDLmain.m into a library for you.

Finally, concerning Apple’s Developer Tools, they’re
free with the operating system on the last CD, and
they are also available for download directly from
Apple. I don’t know how it could be easier to get
than
already having with your operating system CDs. And
before you completely forsake the Xcode tools (it
sounds like you’re running Panther from the message
topic), they have some very nice features available
you might want to consider using. This is not to
steer
you away from Makefiles, but you might consider
using
both in your development to get the best of both
worlds.

-Eric


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

Perhaps I will look more closely at XCode, but only
because you’ve said it has some useful features. But
I
refuse to include it as part of the build process or
use any special code generation that would require
that a person who wants to modify my work have
XCode.
Simply put, you may say it’s simple to get XCode,
and
it probably is, but it still doesn’t meet my
standard
of popularity. I don’t want people to have to
download
10 packages if they choose to help develop my
software, and while SDL + XCode only makes 2, who
knows what XCode’s prerequisites are, and if I make
it
a policy to incur new prerequisite software on a
whim,
then I’ll probably end up with a lot more than
anyone
wants to deal with. (Or, perhaps no one else in the
world has my intolerance for dependancy hell :slight_smile: )

Actually, I think in order to get Apple’s gcc and
Terminal, you must install the Developer Tools which
includes Xcode. Thus anybody running Panther who
expects to compile your stuff must already have the
developer tools installed anyway.

As for popularity, I don’t know the numbers, but
there’s a whole convention of developers meeting up in
July for WWDC who might disagree with your assessment
:slight_smile: Remember that Macs are a pretty small minority to
begin with, so it might be hard to assess the
popularity of Xcode if you’re looking at sites that
focus energy on Linux or Windows. But popular or not,
since Xcode is Apple’s official developer IDE, they
are going to push it on people. If you look at any Mac
specific programming books, they all use Project
Builder or Xcode.

I’m not trying to deter you from using Makefiles. If
you want to use them, that’s great. But you shouldn’t
base your decision to use or not use Xcode based on
incorrect reasons.

-Eric> From: Donny Viszneki

I’m kind of afraid this thread is getting very
offtopic…

— Eric Wing wrote:

Perhaps I will look more closely at XCode, but
only
because you’ve said it has some useful features.
But
I
refuse to include it as part of the build process
or
use any special code generation that would require
that a person who wants to modify my work have
XCode.
Simply put, you may say it’s simple to get XCode,
and
it probably is, but it still doesn’t meet my
standard
of popularity. I don’t want people to have to
download
10 packages if they choose to help develop my
software, and while SDL + XCode only makes 2, who
knows what XCode’s prerequisites are, and if I
make
it
a policy to incur new prerequisite software on a
whim,
then I’ll probably end up with a lot more than
anyone
wants to deal with. (Or, perhaps no one else in
the
world has my intolerance for dependancy hell :slight_smile: )

Actually, I think in order to get Apple’s gcc and
Terminal, you must install the Developer Tools which
includes Xcode. Thus anybody running Panther who
expects to compile your stuff must already have the
developer tools installed anyway.

I should have pointed this out earlier: I don’t intend
my end users to be running any particular operating
system, that includes Panther and OS X.

As for popularity, I don’t know the numbers, but
there’s a whole convention of developers meeting up
in
July for WWDC who might disagree with your
assessment

Software development conventions only prove that there
are a few thousand people with enough money and
freedom to take a week long trip to talk to
like-minded developers. It has little to do with how
popular it actually is. If anything, the attandance of
a convention is often the measure of user’s
dedication, not their numbers.

:slight_smile: Remember that Macs are a pretty small minority to
begin with, so it might be hard to assess the
popularity of Xcode if you’re looking at sites that
focus energy on Linux or Windows.

I don’t base it on sites, I base it on free, open
source operating system distributions. To date, not
one includes XCode even as an option. To me, this
means it isn’t good enough (that doesn’t mean it’s not
just as good as the software that would take its
place, it just means it’s not particularly better.)

Like it or not,
since Xcode is Apple’s official developer IDE, they
are going to push it on people.

No one can push anything on you you don’t really want.
If they decide to try and lock me into using XCode, I
may just stop using OSX.

If you look at any
Mac
specific programming books, they all use Project
Builder or Xcode.

That’s because if they weren’t Mac-specific, but were
for still for Mac developers, well then they’d just be
Unix development books wouldn’t they? And those books
do exist in far greater numbers.

I’m not trying to deter you from using Makefiles. If
you want to use them, that’s great.

I don’t personally want to use make, but I think
that’s the fastest, cheapest way for all users to
build my source code.

But you
shouldn’t
base your decision to use or not use Xcode based on
incorrect reasons.

I agree. I wish XCode just used another application’s
syntax definition files like Vim or something, so that
I could actually edit source code in it that isn’t a
format syntax they had initially thought of. Apple may
be embracing Open Source on the surface, but if they
aren’t reusing software that’s already been written,
then they’re really missing a big part of it.> > From: Donny Viszneki

-Eric


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

— Donny Viszneki wrote:

This helps GCC find SDL includes and libraries. So
next this happened:

~/$ cc -lSDL -lSDLmain test.c
ld: /opt/local/lib/libSDLmain.a(SDLMain.o) illegal
reference to symbol:
.objc_class_name_NSAppleMenuController defined in
indirectly referenced dynamic library

I’m not sure if what I’m about to say will help you, since I use the
framework versions of the SDL library, not the DarwinPorts/Fink
versions… but it sounds to me like you need to add the "-lobjc"
and possibly “-framework Cocoa” compiler options.–
Steve

Find local movie times and trailers on Yahoo! Movies.

— Steven Saunders <s_j_nevets at yahoo.com.au> wrote:

— Donny Viszneki wrote:

This helps GCC find SDL includes and libraries. So
next this happened:

~/$ cc -lSDL -lSDLmain test.c
ld: /opt/local/lib/libSDLmain.a(SDLMain.o) illegal
reference to symbol:
.objc_class_name_NSAppleMenuController defined in
indirectly referenced dynamic library

I’m not sure if what I’m about to say will help you,
since I use the
framework versions of the SDL library, not the
DarwinPorts/Fink
versions… but it sounds to me like you need to
add the "-lobjc"
and possibly “-framework Cocoa” compiler options.

Thank you so much. I had I been a little bit more
persistent perhaps I would have tried this. I guess
this also explains what an “indirect reference” linker
error is. For the record, it works even without the
-lobjc, I believe the Cocoa framework implies this.

Thanks again.__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/