OS X double clicking vs. open

Hello,

I have developed an application using SDL for OS X with XCode. Starting
the application by double clicking on the application works. But when
starting the program from the command line (“open something.app”) I get
the following errors:

dyld:
/Users/bobsturm/PacificPulses/PPgui_anim/OSX/PPgui/build/PPgui.app/Contents/MacOS/PPgui
Undefined symbols:

SDL undefined reference to _glGetIntegerv expected to be defined in OpenGL

SDL undefined reference to _glClear expected to be defined in OpenGL

OpenGL undefined reference to _CGLSetCurrentContext expected to be defined
in /usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _gll_noop expected to be defined in
/usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _gll_pkey expected to be defined in
/usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _CGLGetCurrentContext expected to be defined
in /usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _CGLSetCurrentContext expected to be defined
in /usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _glGetBooleanv expected to be defined in
/usr/X11R6/lib/libGL.dylib

OpenGL undefined reference to _glGetIntegerv expected to be defined in
/usr/X11R6/lib/libGL.dylib—
I’ve noticed this also happens when I try to run any of the SDL tests. I
see that within the SDLMain.m there is code that says within main a
special condition if “launched by double clicking.” But when I put a
printf statement in there and launch using open, it prints nothing…as if
the objective C code is not even being executed by the open statement.

Any suggestions?

Thanks.
-Bob.

Bob L. Sturm
Graduate Program in Media Arts & Technology
3431 South Hall
University of California, Santa Barbara
Santa Barbara, CA 93106-6070

I have developed an application using SDL for OS X with XCode. Starting
the application by double clicking on the application works. But when
starting the program from the command line (“open something.app”) I get
the following errors…

I have no idea where your errors come from, but it doesn’t seem to be a
general problem - I can launch my own SDL+OpenGL apps just fine with
’open’. It seems very strange that OpenGL.framework would look for
symbols in /usr/X11R6/lib/libGL.dylib, which isn’t even there on a
standard install without X11. Have you tried different SDL versions?
Self-compiled vs. binary release? With/without ZeroLink? With/without
dead code stripping? What about other OpenGL apps?

I see that within the SDLMain.m there is code that says within main a
special condition if “launched by double clicking.” But when I put a
printf statement in there and launch using open, it prints nothing…as if
the objective C code is not even being executed by the open statement.

Did you look for the output in the terminal window where you ran ‘open’?
Your application’s standard output is not connected to that terminal,
but to the console log, just like if you had launched it by
double-clicking. Use /Applications/Utilities/Console to view the console
log.

-Christian