无法包含带有GCC的文件

无法包含带有GCC的文件,c,gcc,build,compiler-errors,C,Gcc,Build,Compiler Errors,我在这个项目中工作,需要我使用一些很久以前编写的软件,现在是开源的,可以在上找到。该软件基本上是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/r

我在这个项目中工作,需要我使用一些很久以前编写的软件,现在是开源的,可以在上找到。该软件基本上是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...
我相信这句话: set gccinclude=“/u/products/toolset/release/build/include/gcc” 在MOS_occam=/inmos/prod/d4205a中设置 指定编译过程中.h文件的存储位置,inmos_occam变量告诉我希望将最终二进制文件存储在哪里,因此我将其更改为: 设置gccinclude=“/usr/include” 在MOS\U occam=/箱中设置 问题是,当我运行脚本时,会出现以下错误:

--- 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....
——arglib
gcc-I./-nostinc/usr/include./arg.c-c-o arg.o-ansi-DSUN4
./arg.c:9:19:致命错误:ctype.h:没有这样的文件或目录
#包括
^
编译终止。
make:**[arg.a]错误1
---extlib
gcc-c-msoft float-Wall-ansi-pedantic-nostinc/usr/include I/home/andres/Documents/T2015 Compiler/src/include-DGNU extconv.c
在/home/andres/Documents/T2015 Compiler/src/include/extlib.h:8:0中包含的文件中,
摘自extconv.c:1:
/home/andres/Documents/T2015 Compiler/src/include/imsstd.h:30:19:致命错误:stdio.h:没有这样的文件或目录
#包括
……还有更多。。。。
我对GCC不太了解,但我相信问题在于参数'-nostdinc'告诉编译器不要查看标准的include目录(文件在我的ubuntu系统中的位置),这就是为什么它不工作的原因。但是,我不知道如何覆盖此行为。我将非常感谢您的帮助,以便我可以编译此文件,如果您认为这不是问题的原因,请务必让我知道


谢谢

-nosdinc
表示您忽略了标准的include路径,我猜这是您不想要的。然而,我可以看到:

gcc -I./ -nostdinc /usr/include ./arg.c -c -o arg.o -ansi -DSUN4
/usr/include
应该类似于
-I/usr/include
,以便将其包含到include路径中

以后你有

I/home/andres/Documents/T2015-Compiler/src/include
应该是哪一个

-I/home/andres/Documents/T2015-Compiler/src/include

谢谢你的回复,关于“I”和“-I”的问题,我实际上有它,因为“-I”只是当我从命令行复制时,我犯了一个错误。我尝试设置“set gccinclude=“-I/usr/include””,这似乎有我想要的效果,但我相信我的机器上确实缺少一些库,例如“sys/cdefs.h”,如果有库丢失,链接器应该投诉。如果缺少标题,编译器应该投诉。