我正在尝试使用编译器选项c99或gnu99编译GNUstep程序,但是它不被识别……这是我的makefile:
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = triangular
triangular_C_FLAGS = -std=gnu99
triangular_HEADERS =
triangular_OBJC_FILES = main.m
triangular_RESOURCE_FILES =
include $(GNUSTEP_MAKEFILES)/tool.make谁能给我指出正确的方向,或者让我知道我做错了什么?
以下是make的输出:
This is gnustep-make 2.6.0. Type 'make print-gnustep-make-help' for help.
Making all for tool triangular...
Compiling file main.m ...
main.m: In function 'main':
main.m:18:3: error: 'for' loop initial declarations are only allowed in C99 mode
main.m:18:3: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [obj/triangular.obj/main.m.o] Error 1
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [triangular.all.tool.variables] Error 2
make: *** [internal-all] Error 2发布于 2011-12-16 10:01:54
ADDITIONAL_FLAGS += -std=gnu99为我工作(灵感来自https://github.com/maddox/regexkit/blob/master/GNUstep/GNUmakefile
发布于 2011-06-30 13:22:45
乍一看,在不知道包含的makefile内容的情况下,这看起来像是automake的输入,它将变量转换为适当的规则。你是如何运行你的makefile的?你是在运行make还是automake makefile.am还是别的什么?
可以尝试的一件事是只添加下面这行
CFLAGS+=-std=gnu99添加到你的makefile中。
发布于 2011-06-30 20:37:42
我对GNUstep一无所知,但the documentation似乎建议您应该使用triangular_CFLAGS (在C和标志之间不带下划线)。
此外,我对ObjC的了解更少,但我想知道您是否不应该使用triangular_OBJCFLAGS?
https://stackoverflow.com/questions/6529715
复制相似问题