Is it possible to build objective c code correctly with GCC under cygwin.
I have the following application that should work on a Mac environment, but can't get the most basic stuff to work with gcc. Are there more libraries I need to have.
#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
Error: 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