Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cossie

macrumors member
Original poster
Aug 8, 2006
74
0
Hi,

I've written a pretty straight forward GLUT app in XCode, it compiles and runs fine when I'm in XCode.

I built the executable version of it, so I now have the .app file.

When I go to click on the file to run, it does nothing, an icon briefly flashes up in the dock and then disappears. I've also tried running it from a terminal but nothing happens at all.

My previous development background is mostly Windows and Visual Studio based so I may be missing something in the build of the release, but I really don't think I am.

Any tips would be great!

Cossie
 
What does the console say? This is in Xcode==>Run==>Console if you are running it in Xcode or /Applications/Utilities/ if you aren't running it in Xcode.
 
I completely forgot to look at the console output!

I fixed the problem, it was incredibly thick of me, I was testing out if you could pass arguments / parameters to an glut application, which worked fine in Xcode because I could go "Project > Edit Active Executable..." and add the arguments there. So stupid of me not to cop on to that! :(

Which leads me to my next question, is it possible to pass arguments to an application in OS X?

I know how to do it in XP, simply by editing the shortcut or running the program from either the Run prompt or a DOS prompt.
 
It's cool, I figured out how to do it :)

Code:
ApplicationName.app/Contents/MacOS/ApplicationName arg1 arg2 etc
 
Just as you would think. For example if I want to open song.mp3 with QuickTime, I would:
Code:
open -a "QuickTime Player" song.mp3

I'm not sure if that actually passes an argument to the program in the command-line sense.

If I do
Code:
/Applications/VLC.app/Contents/MacOS/VLC -h
I get help text outputted to standard out and VLC does not open, but if I do
Code:
open -a VLC -h
VLC opens instead of help text being outputted.
 
I'm not sure if that actually passes an argument to the program in the command-line sense.

You're right, it doesn't. All the arguments in that example are to the 'open' command itself. -a tells it that the next argument is the name of the application to use to open the file, and song.mp3 is the argument that specifies which file to open. To actually pass arguments to QT Player itself (assuming it
takes arguments, have no idea if it does), you'd invoke the executable directly something like (off the top of my head):

Code:
/Applications/QuickTime Player/Contents/MacOS/QuickTime\ Player arg1 arg2

This actually can occasionally be somewhat useful, or at least convenient because if you invoke an app from the command line this way, log messages get output to the terminal window. That way you don't have to go into Console to find them.
 
Glut console program gets “EXC_BAD_ACCESS”

Hi,
I am having similar problems. I included the frameworks for Glut and openGL. I included some others as well for date/time/string handling. The console icon appears on the desktop but gets the “EXC_BAD_ACCESS” message in the error log and doesn't display.
I would have tried posting this as a new thread, which I MAY do, but I can't figure out how. Actually a friend just told me now that I might not be able to while they evaluate if I'm a bot.
Thanks for your help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.