[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with my first app
From: |
Gregory Casamento |
Subject: |
Re: Problem with my first app |
Date: |
Sat, 13 Oct 2001 09:43:19 -0700 (PDT) |
The file should have a '.m' extension for gcc to recognize it as an Objective-C
source file.
--- PERON Stéphane <speron@telys.com> wrote:
> Thanks all,
> I didn't know it was so hard to make a basic application :-)
>
> With all changements, I always have problems at compilation :
>
> /opt/GNUstep/System/Headers/AppKit/NSWorkspace.h:201: parse error
> before `*'
> /opt/GNUstep/System/Headers/AppKit/NSWorkspace.h:201: warning: data
> definition has no type or storage class
> Encod.c:4: parse error before `@'
>
> You will find below my last code (in Encod.c) :
>
> #include <Foundation/Foundation.h>
> #include <AppKit/AppKit.h>
>
> @interface MyDelegate : NSObject
> - (void) applicationWillFinishLaunching: (NSNotification *)not;
> @end
>
> @implementation MyDelegate
> - (void) applicationWillFinishLaunching: (NSNotification *)not
> {
> menu = AUTORELEASE ([NSMenu new]);
> [menu addItemWithTitle: @"Quit"
> action: @selector (terminate:)
> keyEquivalent: @"q"];
> [NSApp setMainMenu : menu];
> }
> @end
>
> int main(int argc, const char **argv)
> {
> [NSApplication sharedApplication];
> [NSApp setDelegate: [MyDelegate new]];
>
> return NSApplicationMain (argc, argv);
> }
>
>
> Any new Idea ? :)
>
> Thanks !
>
>
>
> On 13/10/2001, Pierre-Yves Rivaille wrote:
> > I don't have the exact same error messages as you, probably because I'm
> > using gcc 3.0.2. But :
> >
> > > #include <Foundation/Foundation.h>
> > > #include <AppKit/AppKit.h>
> > >
> > > @interface MyDelegate : NSObject
> > > - (void) applicationWillFinishLaunching: (NSNotification *)not;
> > > @end
> > >
> > > @implementation MyDelegate : NSObject
> >
> > should be
> >
> > @implementation MyDelegate
> >
> > because inheritance is only specified in the @interface part.
> >
> >
> > > - (void) applicationWillFinishLaunching: (NSNotification *)not
> > > {
> > > NSMenu *menu;
> > > menu = AUTORELEASE ([NSMenu New]);
> >
> > should be
> > menu = AUTORELEASE ([NSMenu new]);
> >
> > > [menu addItemWithTitle: @"Quit"
> > > action: @selector (terminate:)
> > > keyEquivalent: @"q"];
> > > [NSApp setMainMenu : menu];
> > > }
> > > @end
> > >
> > > int main(int argc, const char **argv)
> > > {
> > > [NSApplication sharedApplication];
> > > [NSApp setDelegate: [MyDelegate new]];
> > >
> > > return NSApplicationMain (argc, argv);
> > > }
> >
> > Pierre-Yves
> >
>
> --
> *****************
> Stéphane PERON
> speron@telys.com
> *****************
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://mail.gnu.org/mailman/listinfo/discuss-gnustep
=====
Gregory John Casamento
__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com
- Problem with my first app, PERON Stéphane, 2001/10/13
- Re: Problem with my first app, Jeff Teunissen, 2001/10/13
- Re: Problem with my first app, Pascal Bourguignon, 2001/10/13
- Re: Problem with my first app, Philippe C.D. Robert, 2001/10/14
- Re: Problem with my first app, Richard Frith-Macdonald, 2001/10/14
- import/include philosophical Was: Problem with my first app, Pascal Bourguignon, 2001/10/14
- Re: Problem with my first app, Philippe C.D. Robert, 2001/10/14
- Re: Problem with my first app, Pascal Bourguignon, 2001/10/14
- Re: Problem with my first app, Nicola Pero, 2001/10/14
- Re: Problem with my first app, Nicola Pero, 2001/10/14
- Re: Problem with my first app, Philippe C.D. Robert, 2001/10/14
Re: Problem with my first app, Nicola Pero, 2001/10/13