Mac OS X Linking problems

Hi guys,
I’ve been trying to build some of my SDL projects on my iBook, but
I ve run into a roadblock. I’m trying to use the standard Unix build
tools from the command line. The projects compile fine, but the
Linker complains that it cant find the SDL library. I’ve installed both
the development and run-time SDL packages, so I know they’re on
there somewhere. So what am I missing?
Is it it even possible to compile SDL programs from the command
line? or do I have to use Project Builder?
I’m running Mac OS X (10.1) …and here’s the command in make
c++ -lSDL -lSDL_mixer -lpthread Program.cpp Object1.o
Object2.o Object3.o -oTestProg

I also noticed in the README something about the SDL run-time
package doesnt support command line stuff…but it is available if
compiled from source(???).
I tried builing SDL from the Source package…but "make install"
failed because of some permissions problem. Do I have to be Root
to install?
If so, does anyone know how to login as root from the terminal?
Whenever I try I get either “Sorry” or “Root Login not permitted on
this Terminal”.

Thanx in advance,
Jason
Jason Remley

@Jason_Remley (Home)
jareml00 at pop.uky.edu (School)
jremley at envirodatagroup.com (Work)

The greatest of all wonders is not the conquerer of the world but the subduer of himself.
-Will Durant

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPfreeware 6.5.3 for non-commercial use http://www.pgp.com

mQGiBDlI/gwRBADxonJSc9OoEen/JO+7Fqdr/SqebGk+G6gtAyx1EpIav4eLdNsh
iy1yBqJzgGproDgi3Ys/lLaUCggqqrUaaC1RmnGgVaE9OyzirW/2ed4yxmftxgeH
Vf7C+mj7RI/IdJ6OeYDwHFFmwJ/OyFYY9dv0y3+bH9LLgtnMat8X97OgdwCg/3cc
VrLC6kFsT7QdHDy+czOIjpEEALjJT8bCGCvF4mWezdrRwrP+GwioHWPm/Q2LHdVy
vnMaUOwAhQ/4TpER0HY+Z6UKueatuLN5QKSv/jlzguqezzI1Yr1CV4xOdTbIt14L
WopbgbJqfSOm7xEUKWeYEwHi3FGuitKBtUk+eYrFT21kUfowcHcarxV7iQBgPYVQ
m0l+BACHiV77ABG8yDTIcVMM4AaSfRKFjuI7dvRU1eYARbz4rHDfn+FRKfwGZHJ0
h2igG0t5ltUP+hr4IgfYWAg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c
UsXfSX4Hiw==
=ISIs
-----END PGP PUBLIC KEY BLOCK-----

I also noticed in the README something about the SDL run-time
package doesnt support command line stuff…but it is available if
compiled from source(???).
I tried builing SDL from the Source package…but "make install"
failed because of some permissions problem. Do I have to be Root
to install?

Yes.

If so, does anyone know how to login as root from the terminal?
Whenever I try I get either “Sorry” or “Root Login not permitted on
this Terminal”.

Just type

sudo make install

from the SDL source directory. Then input your own password :wink:

Regards,
.paul.On Tue, Sep 10, 2002 at 04:48:37PM -0000, Jason Remley wrote:

Is it it even possible to compile SDL programs from the command
line? or do I have to use Project Builder?
I’m running Mac OS X (10.1) …and here’s the command in make
c++ -lSDL -lSDL_mixer -lpthread Program.cpp Object1.o
Object2.o Object3.o -oTestProg

I may be wrong, as I rarely compile outside of project builder and I’ve
not done C++ with SDL yet, but you probably need to include the
frameworks:

-framework SDL -framework SDL_Mixer

in the command within make. This has certainly worked for the C
projects I’ve compiled.

If so, does anyone know how to login as root from the terminal?
Whenever I try I get either “Sorry” or “Root Login not permitted on
this Terminal”.

You can enable the root user from within Netinfomanager.app, see the
"Security -> Enable root user" menu option – when that’s done you can
su to root as usual.

On some OS X installs I’ve had, sudo still refuses to work even with
your own password. This happened to me on my iBook, yet my TiBook was
fine. Go figure…

Cheers

G–
“The probability of someone watching you is proportional to the
stupidity of your action.”

Hi guys,
I’ve been trying to build some of my SDL projects on my iBook, but
I ve run into a roadblock. I’m trying to use the standard Unix build
tools from the command line. The projects compile fine, but the
Linker complains that it cant find the SDL library. I’ve installed both
the development and run-time SDL packages, so I know they’re on
there somewhere.

As noted in the installer readme, the runtime lib is installed in
/Library/Frameworks and development runtime lib is in
~/Library/Frameworks

So what am I missing?
Is it it even possible to compile SDL programs from the command
line? or do I have to use Project Builder?

You don’t have to use Project Builder. Below is one way to do it. The
other way is to get the source and build it from the command line -
then your command will almost work (you still need to have SDLMain.o in
there). The latter approach can also build a .app wrapper for your
program.

I’m running Mac OS X (10.1) …and here’s the command in make
c++ -lSDL -lSDL_mixer -lpthread Program.cpp Object1.o
Object2.o Object3.o -oTestProg

If you installed the .pkg files for SDL and SDL_mixer, this command
will work:

c++ -framework SDL -framework SDL_mixer
-I$(HOME)/Library/Frameworks/SDL.framework/Headers
-I$(HOME)/Library/Frameworks/SDL_mixer.framework/Headers -lpthread
Program.cpp SDLMain.o Object1.o
Object2.o Object3.o -oTestProg

Note that you need SDLMain.o, compile that from SDLMain.m which
you’ll find by creating a new SDL project in Project Builder.

If so, does anyone know how to login as root from the terminal?
Whenever I try I get either “Sorry” or “Root Login not permitted on
this Terminal”.

You have to use sudo. You can’t use “su”, unless you’ve enabled the
root account in NetInfo Manager.On Tuesday, September 10, 2002, at 12:48 PM, Jason Remley wrote: