【发布时间】:2009-09-23 15:25:25
【问题描述】:
是否可以在cygwin下使用GCC正确构建目标c代码。
我有以下应用程序,应该可以在 Mac 环境中运行,但无法获得最基本的东西来使用 gcc。我还需要更多的库吗?
#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
错误:
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
【问题讨论】:
标签: objective-c windows winapi gcc cygwin