discuss-gnustep
[Top][All Lists]
Advanced

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

Re: getting : error: 'autoreleasepool' undeclared (first use in this fun


From: Fred Kiefer
Subject: Re: getting : error: 'autoreleasepool' undeclared (first use in this function)
Date: Wed, 2 Jan 2013 22:44:25 +0100

The new statement @autoreleasepool is only supported in clang. Either you 
switch to that compiler or you have to declare your auto release pools the old 
fashioned way.

On the road

Am 02.01.2013 um 15:33 schrieb umen <meiry242@gmail.com>:

> Hello all
> im using gnusetup to learn objC , its great but . now i have basic error
> which i can't find any hint how solve it 
> i have this simple main :
> #import <stdio.h> 
> #import <Foundation/Foundation.h>
> #import "ClassA.h"
> #import "ClassB.h"
> 
> int main(int argsc,const char** argsv)
> {
>    @autoreleasepool {
>         
>        ClassB* pClassB ;
>        pClassB = [[ClassB alloc] init];
>        
>        
>        
>        [pClassB printX];
>        [pClassB initVar:5];
>        [pClassB printX];
>    }
>    return 0;
> }
> 
> and the make file that looks like this :
> include $(GNUSTEP_MAKEFILES)/common.make 
> TOOL_NAME = IntTestInheritance
> IntTestInheritance_HEADERS =  ClassA.h
> IntTestInheritance_OBJC_FILES = main.m ClassA.m
> IntTestInheritance_RESOURCE_FILES =
> 
> include $(GNUSTEP_MAKEFILES)/tool.make
> 
> 
> and when compiling im getting this error:
> $ make
> This is gnustep-make 2.6.2. Type 'make print-gnustep-make-help' for help.
> Making all for tool IntTestInheritance...
> Compiling file main.m ...
> main.m: In function 'main':
> main.m:8:2: error: stray '@' in program
> main.m:8:3: error: 'autoreleasepool' undeclared (first use in this function)
> main.m:8:3: note: each undeclared identifier is reported only once for each
> function it appears in
> main.m:8:19: error: expected ';' before '{' token
> main.m:22:1: warning: control reaches end of non-void function
> [-Wreturn-type]
> make[3]: *** [obj/IntTestInheritance.obj/main.m.o] Error 1
> make[2]: *** [internal-tool-all_] Error 2
> make[1]: *** [IntTestInheritance.all.tool.variables] Error 2
> make: *** [internal-all] Error 2
> 
> why ? 
> thanks !
> 
> 
> 
> --
> View this message in context: 
> http://gnustep.8.n7.nabble.com/getting-error-autoreleasepool-undeclared-first-use-in-this-function-tp32251.html
> Sent from the GNUstep - General mailing list archive at Nabble.com.
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep



reply via email to

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