GCC编译器

vi /etc/bash.bashrc


一、
./configure --prefix=/etc/snmp --with-mib-modules='ucd-snmp/diskio ip-mib/ipv4InterfaceTable'


make的时候报错
ecs-800a-0001:~/net-snmp-5.7.3 # make
make: *** No targets specified and no makefile found.  Stop.
原因:认为是没有ncurse包,所以安装这个包。




二、安装nurse包
ecs-800a-0001:~/ncurses-5.6 #  ./configure -prefix=/usr/local -with-shared-without-debug


checking for egrep... grep -E
Configuring NCURSES 5.6 ABI 5 (Wed Mar 14 19:23:58 CST 2018)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring for linux-gnu
checking for prefix... /usr/local
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable cc found in $PATH
问题:安装软件的时候,运行./confugure时出现错误:configure: error: no acceptable cc found in $PATH
原因:这是缺少GCC编译器造成的。安装GCC编译器即可。
三、安装GCC编译器:
首先准备好arm-linux-gcc的包,比如说是arm-linux-gcc-fh.tar.gz。
首先是解压缩,路径可以随便放,最好放在/opt这个目录下面。
使用如下命令:
    tar xvzf arm-linux-gcc-fh.tar.gz(空格)C(空格/(注意这之间的空格)。
然后就解压缩好了,接下来就是要修改一下配置文件了。
切换到root权限,输入如下命令:
    vi /etc/bash.bashrc
在最后面一行加入如下语句:
    export PATH=$PATH:/opt/***(***表示你的arm-linux-gcc这个可执行文件的路径);
最后,重启一下配置文件,使用如下命令:
    source /etc/bash.bashrc,


安装GCC编译器后,重新执行./configure,生成一个file(make的时候需要这个文件),然后再去make、makeinstall。


四、执行完上述步骤,重新执行./configure -prefix=/root/ncutses -with-shared-without-debug


ecs-800a-0001:~/ncurses-5.6 # ./configure -prefix=/root/ncutses -with-shared-without-debug
checking for egrep... grep -E
Configuring NCURSES 5.6 ABI 5 (Thu Mar 15 09:20:30 CST 2018)
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
Configuring for linux-gnu
checking for prefix... /root/ncutses
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
ecs-800a-0001:~/ncurses-5.6 #


又报错:error: C compiler cannot create executables


五.现在的情况是,只要执行./configure就会出现报错error: C compiler cannot create executables
上网搜寻原因后,初步认为,是配置文件/etc/bash.bashrc有问题,所以讲第三步对该文件的修改回滚。再运行./configure配置文件的时候,报错如下:configure: error: no acceptable C compiler found in $PATH


六、重新解压了arm-linux-gcc的包,并重新修改了文件/etc/bash.bashrc,修改为:ecs-800a-0001:/opt/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/bin
source生效配置文件后,重新运行./configure --prefix=/etc/snmp --with-mib-modules='ucd-snmp/diskio ip-mib/ipv4InterfaceTable'
运行结果为:C compiler cannot create executables





猜你喜欢

转载自blog.csdn.net/gramdog/article/details/79929937