Helfen Sie mit GCC und ObjectiveC-code und Cygwin

Ist es möglich, zu bauen objective-c-code korrekt mit GCC unter cygwin.

Habe ich die folgende Anwendung, sollte die Arbeit an einer Mac-Umgebung, kann aber nicht die einfachsten Sachen auf die Arbeit mit gcc. Gibt es noch weitere Bibliotheken, die ich brauche zu haben.

#import "HelloWorldApp.h"

int main(int argc, char *argv[]) {
    return 0;
} //End of the //

@interface Car
{
    int test;
}

//The registration is a read-only field, set by copy
@property int (readonly, copy) test;

//the driver is a weak reference (no retain), and can be modified
//@property Person* (assign) driver;

@end


CC=gcc
CXX=gcc-g++
LD=$(CC)

CFLAGS=

LDFLAGS=-lobjc

all: HelloWorld

HelloWorld: HelloWorld.o
    $(LD) $(LDFLAGS) -o $@ $^

%.o: %.m
    $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@

clean:
    rm -rvf *.o HelloWorld HelloWorld.exe

Fehler:

gcc -c HelloWorld.m -o HelloWorld.o
In file included from HelloWorld.m:6:
HelloWorldApp.h:19: error: stray '@' in program
HelloWorldApp.h:19: error: parse error before "int"
make: *** [HelloWorld.o] Error 1
InformationsquelleAutor Berlin Brown | 2009-09-23
Schreibe einen Kommentar