discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with my first app


From: PERON Stéphane
Subject: Re: Problem with my first app
Date: Sat, 13 Oct 2001 15:57:03 -0400
User-agent: Mutt/1.3.18i

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
*****************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]