【发布时间】:2015-01-29 12:34:58
【问题描述】:
我正在从事这个项目,该项目需要我使用一些很久以前编写的软件,现在已经开源,可以在http://www.wotug.org/occam/compilers/oc/oc-src.tar.gz 找到。该软件基本上是 Occam 的编译器。
当我解压 tar.gz 时,我找到了一个源文件夹,其中包含用于构建软件的 csh 脚本。
#!/bin/csh -f
#
# Quick build script for occam compiler and libraries
#
# You will need to redefine these
set gccinclude = "/u/products/toolset/release/build/include/gcc"
set inmos_occam = /inmos/prod/d4205a
# These should be ok
set base_dir = $cwd
set path = ($inmos_occam/tools $base_dir/preocc $path)
setenv ISEARCH "$base_dir/libs/ $base_dir/include/ $gccinclude/"
set buildlibs = (arglib extlib tcofflib)
foreach buildlib ($buildlibs)
echo --- $buildlib
cd $buildlib
make -f [Mm]akefile.s4 COMMON=$base_dir GCCINCLUDE=$gccinclude TLIB=
cd ..
end
... some other stuff...
我相信以下几行: 设置 gccinclude = "/u/products/toolset/release/build/include/gcc" 设置 inmos_occam = /inmos/prod/d4205a 为编译过程指定 .h 文件的存储位置,inmos_occam 变量告诉我希望最终二进制文件存储在哪里,所以我将它们更改为: 设置 gccinclude = "/usr/include" 设置 inmos_occam = ./bin 问题是当我运行脚本时出现以下错误:
--- arglib
gcc -I./ -nostdinc /usr/include ./arg.c -c -o arg.o -ansi -DSUN4
./arg.c:9:19: fatal error: ctype.h: No such file or directory
#include <ctype.h>
^
compilation terminated.
make: *** [arg.a] Error 1
--- extlib
gcc -c -msoft-float -Wall -ansi -pedantic -nostdinc /usr/include I/home/andres/Documents/T2015-Compiler/src/include -DGNU extconv.c
In file included from /home/andres/Documents/T2015-Compiler/src/include/extlib.h:8:0,
from extconv.c:1:
/home/andres/Documents/T2015-Compiler/src/include/imsstd.h:30:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
....and a lot more....
我对 GCC 了解不多,但我认为问题在于参数“-nostdinc”告诉编译器不要查看标准包含目录(文件在我的 ubuntu 系统中的位置),这就是它的原因不工作。但是,我不知道如何覆盖这种行为。非常感谢帮助,以便我可以编译它,如果您认为这不是问题的原因,请告诉我。
谢谢!
【问题讨论】:
标签: c gcc build compiler-errors