No menu for no-nib app

larschassing

Registered
I have tried the example in
http://www.omnigroup.com/mailman/archive/macosx-dev/2001-June/016346.html
It works fine if I do as he says in Project Builder,
but I want to compile from the commandline:

cc main.m RawApp.m
./a.out

A window does appear, but even if I click in it the program's menu does not appear!
How can that be?

And, how do I make the a.out executable from Finder's point of view,
so that I can double-click on it in Finder to launch it.

Best regards from Denmark
/Lars
 
This is because when you compile it on the command line, you're only making the executable, where Project Builder makes an application package.

If you look at almost any OS X application in the terminal, you'll see that it shows as a folder rather than an executable.

To make a double-clickable executable from the Finder's point of view, it's easiest to just use Project Builder.
 
Originally posted by Darkshadow
This is because when you compile it on the command line, you're only making the executable, where Project Builder makes an application package.

If you look at almost any OS X application in the terminal, you'll see that it shows as a folder rather than an executable.

To make a double-clickable executable from the Finder's point of view, it's easiest to just use Project Builder.

Thank you for your answer. OK, so I did this:
mkdir aout.app
mkdir aout.app/Contents
mkdir aout.app/Contents/MacOS
mv a.out aout.app/Contents/MacOS
cat >aout.app/Contents/Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>
a.out </string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
</dict>
</plist>

^D

Now I can double-click on aout in Finder and it works.
And from the command line I can:
open aout.app
but not
open aout.app/Contents/MacOS/a.out

Executing
aout.app/Contents/MacOS/a.out
from the command line still shows no menu.

1) Why do I need an application package, why can't it be compiled into a single executable file (only data, no resource fork)?

2) How do I put an application package in my $PATH? Must I use open to launch it?

3) I don't want to use an interactive GUI for building, the build must be handled from the commandline/shell-script. Can I still use PB?
/Lars
 
Back
Top