在Ubuntu 14.04编译器错误上安装高级编程语言

时间:2015-12-02 14:34:02

标签: c++ c linux ubuntu gcc

不再维护SR编程语言,因此我意识到我在这个问题上找到帮助的机会可能很小。但是,我需要为教室目的安装语言,而不能考虑如何继续。

这是网络上关于该语言的看似唯一的信息来源 http://www.cs.arizona.edu/sr/

安装包提供了一个用于安装的Makefile。但是,运行以下内容:

mkdir /usr/local/src/sr
cd /usr/local/src/sr
wget ftp://ftp.cs.arizona.edu/sr/sr.tar.Z
tar xzf sr.tar.Z
make

导致这些错误

echo "#"               >paths.sh
echo "#  Created mechanically;  DO NOT EDIT THIS FILE."   >>paths.sh
echo "#"              >>paths.sh
sed -n >>paths.sh <Configuration  \
    -e 's/#.*//' -e 's/[  ]*$//' -e 's/ *= */=/' \
    -e 's/="*\(.* [^"]*\)"*$/="\1"/' -e '/^[A-Z0-9_]* *=/p'
echo ""               >>paths.sh
echo  >paths.tmp '/*'
echo >>paths.tmp ' *  Created mechanically;  DO NOT EDIT THIS FILE.'
echo >>paths.tmp ' */'
sed  >>paths.tmp <paths.sh \
      -n -e 's/"//g' -e 's/.*/#define &"/' -e 's/= */ "/p'
if cmp -s paths.tmp paths.h; then :; else cp paths.tmp paths.h; fi
cc -g     -c -o util.o util.c
util.c: In function ‘salloc’:
util.c:79:27: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
     return strcpy (alloc (strlen (s) + 1), s);
                           ^
util.c: In function ‘strtail’:
util.c:94:14: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
     int ls = strlen (s);
              ^
util.c: In function ‘setpath’:
util.c:221:25: warning: incompatible implicit declaration of built-in function ‘strlen’ [enabled by default]
     searchpath = alloc (strlen (evpath) + strlen (ifdir) + 100);
                         ^
cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr;    make  CC="cc" CFLAGS="-g  "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g     -c -o main.o main.c
In file included from main.c:7:0:
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token
     ERROR -- no architecture selected
           ^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default]
 options (argc, argv)
 ^
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration
main.c:53:5: note: previous implicit declaration of ‘options’ was here
     options (argc, argv);  /* process options */
     ^
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2

我认为这可能是我使用的编译器版本的问题。 gcc -v返回gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04),安装文件似乎是在早期版本上编译的。我尝试安装早期版本的gcc,使gcc -v产生gcc version 3.4.6 (Debian 3.4.6-5),但遇到类似但不同的编译器错误。也许我对降级安装做了一些错误,因为它显示Debian 3.4.6-5似乎很奇怪。

该软件包还提供了install.sh文件。试图

chmod +x /usr/local/src/sr/install.sh
/usr/local/src/sr/install.sh

返回以下内容:

+ cp sr/sr /usr/local/bin
cp: cannot stat ‘sr/sr’: No such file or directory
+ strip /usr/local/bin/sr
strip: Warning: '/usr/local/bin/sr' is not an ordinary file
+ cp srl/srl /usr/local/bin
cp: cannot stat ‘srl/srl’: No such file or directory
+ strip /usr/local/bin/srl
strip: Warning: '/usr/local/bin/srl' is not an ordinary file
+ cp srm/srm /usr/local/bin
cp: cannot stat ‘srm/srm’: No such file or directory
+ strip /usr/local/bin/srm
strip: Warning: '/usr/local/bin/srm' is not an ordinary file
+ cp srprof/srprof /usr/local/bin
cp: cannot stat ‘srprof/srprof’: No such file or directory
+ strip /usr/local/bin/srprof
strip: Warning: '/usr/local/bin/srprof' is not an ordinary file
+ cp srtex/srtex /usr/local/bin
cp: cannot stat ‘srtex/srtex’: No such file or directory
+ strip /usr/local/bin/srtex
strip: Warning: '/usr/local/bin/srtex' is not an ordinary file
+ cp srlatex/srlatex /usr/local/bin
cp: cannot stat ‘srlatex/srlatex’: No such file or directory
+ strip /usr/local/bin/srlatex
strip: Warning: '/usr/local/bin/srlatex' is not an ordinary file
+ cp srgrind/srgrind /usr/local/bin
cp: cannot stat ‘srgrind/srgrind’: No such file or directory
+ cp preproc/*2sr /usr/local/bin
cp: cannot stat ‘preproc/*2sr’: No such file or directory
+ cp sr.h /usr/local/lib/sr
+ cp srmulti.h /usr/local/lib/sr
+ cp rts/srlib.a /usr/local/lib/sr
cp: cannot stat ‘rts/srlib.a’: No such file or directory
+ [ -f /bin/ranlib -o -f /usr/bin/ranlib ]
+ ranlib /usr/local/lib/sr/srlib.a
ranlib: '/usr/local/lib/sr/srlib.a': No such file
+ cp library/*.o /usr/local/lib/sr
cp: cannot stat ‘library/*.o’: No such file or directory
+ cp library/*.spec /usr/local/lib/sr
cp: cannot stat ‘library/*.spec’: No such file or directory
+ cp library/*.impl /usr/local/lib/sr
cp: cannot stat ‘library/*.impl’: No such file or directory
+ cp srmap /usr/local/lib/sr
+ cp rts/srx /usr/local/lib/sr
cp: cannot stat ‘rts/srx’: No such file or directory
+ strip /usr/local/lib/sr/srx
strip: '/usr/local/lib/sr/srx': No such file
+ cp srlatex/srlatex.sty /usr/local/lib/sr
+ cp preproc/ccr2sr.h preproc/csp2sr.h preproc/m2sr.h /usr/local/lib/sr
+ cp sr-mode.el /usr/local/lib/sr
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing man pages for commands
not installing man pages for commands
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing sranimator/srgetopt/srwin man pages
not installing sranimator/srgetopt/srwin man pages
+ [ ! -z /usr/man/manl -a -d /usr/man/manl -a ! -z l ]
+ echo not installing srmap/srtrace man pages
not installing srmap/srtrace man pages
+ exit 0

没有任何反应。

任何人都可以理解这些错误或者至少提供有关如何进行的建议吗?这看起来似乎是徒劳的,因为这种语言十年来一直没有得到维护,但任何建议都会对我有很大帮助。

谢谢

更新 我的同事将这些更改提供给./Configuration文件:

sed -i -e "s:/usr/local:/usr:" -e "s:/usr/X11/lib:/usr/lib:" \
  -e "s:CCPATH = /bin/cc:CCPATH = /usr/bin/gcc" \
  -e "s:RSHPATH = /usr/ucb/rsh:RSHPATH = /usr/bin/ssh:" \
  -e "s:VFPATH = /usr/lib/vfontedpr:VFPATH = :" Configuration

在gcc 4.8.4上运行make之后

cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr;      make  CC="cc" CFLAGS="-g  "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g     -c -o main.o main.c
In file included from main.c:7:0:
../arch.h:147:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘--’ token
     ERROR -- no architecture selected
           ^
main.c:114:1: warning: conflicting types for ‘options’ [enabled by default]
 options (argc, argv)
 ^
main.c:114:1: error: static declaration of ‘options’ follows non-static declaration
main.c:53:5: note: previous implicit declaration of ‘options’ was here
     options (argc, argv);  /* process options */
     ^
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2

它摆脱了最初的路径问题,但编译器问题仍然存在。

使用gcc 3.4,它给出了

cmp -s multi/uni.h srmulti.h || cp multi/uni.h srmulti.h
cmp -s multi/uni.c srmulti.c || cp multi/uni.c srmulti.c
cd sr;      make  CC="cc" CFLAGS="-g  "
make[1]: Entering directory `/usr/local/src/sr/sr'
cc -g     -c -o main.o main.c
In file included from main.c:7:
../arch.h:147: error: syntax error before '--' token
main.c:115: error: conflicting types for 'options'
main.c:53: error: previous implicit declaration of 'options' was here
make[1]: *** [main.o] Error 1
make[1]: Leaving directory `/usr/local/src/sr/sr'
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:1)

&#34; SR&#34; :旧文件→→2001年!

&#34; SR&#34;用gcc版本3.2.3或gcc版本3.4.6编译好( 编辑文件&#39;配置&#39;。 ( 对于Ubuntu 14.04没有gcc32。)

# make install:提供/ usr / local / bin / sr

P.S。 :gcc34适用于Ubuntu 14.04: compat-gcc34-3.4.6-ubuntu1204-1_ amd64 .deb,或compat-gcc34_3.4.6-ubuntu15_ i386 .deb

相关问题