我遇到了一个问题,似乎是由于 gcc 没有找到它附带的标头引起的。对 C/GCC 不太了解,我想我会检查编译器应该始终能够找到这些头文件是否是一个安全的假设。也许设置 -I 参数会覆盖这个?还是其他时髦的东西?
最初的问题是在github 上的鞋子上的这个问题。
原始问题
你好 !我尝试在 10.8 上构建,如另一个问题中所述,使用非 llvm gcc,并通过稍微调整 rakefile 以在正确的位置获取正确的 sdk。
但
它仍然无法编译。
这是错误报告的开头(真的很长)
new-host-2:shoes benjamingattet$ rake gcc -I. -c -o shoes/app.o -Wall -I/usr/local/include -I/usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/1.9.1/x86_64-darwin12.0.0 -I/usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1 -I/usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/x86_64-darwin12.0.0 -O -DRUBY_1_9 -DSHOES_QUARTZ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -fpascal-strings -Os -w -pipe -march=core2 -msse4.1 -mmacosx-version-min=10.8 -fno-common -x objective-c -fobjc-exceptions -isysroot /Developer/SDKs/MacOSX10.8.sdk -arch x86_64 shoes/app.c shoes/app.c:5:18: error: glib.h: No such file or directory In file included from shoes/app.c:6: ./shoes/app.h:13:19: error: cairo.h: No such file or directory In file included from /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby.h:32, from ./shoes/app.h:14, from shoes/app.c:6: /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:48:21: error: string.h: No such file or directory /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:58:21: error: stdint.h: No such file or directory /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:61:23: error: inttypes.h: No such file or directory /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:64:20: error: stdarg.h: No such file or directory /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:65:19: error: stdio.h: No such file or directory In file included from /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:67, from /usr/local/Cellar/ruby/1.9.3-p194/include/ruby-1.9.1/ruby.h:32, from ./shoes/app.h:14,