当前位置: 技术问答>linux和unix
绝望: solaris10安装低版本gcc。报gcc: installation problem, cannot exec `cpp': No such file or directory
来源: 互联网 发布时间:2016-04-05
本文导语: 要在solaris10上跑一个代码,必须用gcc-2.7.2.3才行。这个版本很低,是solaris2.5上的freeware. 我在sunfreeware上找到这个,是for Intel i368 solaris2.5 http://ftp.sunfreeware.com/ftp/pub/freeware/i386/5.5.1/baggett/gcc-2723-opt.tar.gz 解压之后,里...
要在solaris10上跑一个代码,必须用gcc-2.7.2.3才行。这个版本很低,是solaris2.5上的freeware.
我在sunfreeware上找到这个,是for Intel i368 solaris2.5
http://ftp.sunfreeware.com/ftp/pub/freeware/i386/5.5.1/baggett/gcc-2723-opt.tar.gz
解压之后,里面已经包括了。
/bin
/lib
/info
/i386_unknown_solaris2.6
/man
这些是不是已经编译好的?只需指明PATH,不用再安装了吧?
我直接在~/bashrc上加了这些
PATH=原来的路径/gcc目录/bin
LD_LIBRARY_PATH=/gcc目录/lib/gcc-lib/i386_unknown_solaris2.6/2.7.2.3 -->这里有.a文件和include目录。
改完也都用source命令刷新了。
可是当运行gcc test.c的时候,抱错:
gcc: installation problem, cannot exec `cpp': No such file or directory
而在/gcc目录/lib/gcc-lib/Intel_unknown_solaris2.6/2.7.2.3下面有名为cpp的文件啊?怎么回事?
再有,我的gcc目录是我自己制定的,难道需要放在一个特定的目录下吗?
这个code对我极为重要,我又刚刚开始用solaris和unix,对gcc一窍不通,请各位大侠提供一个具体的解释,谢谢。
gcc的连接就在上面,请各位帮我看一下。
我在sunfreeware上找到这个,是for Intel i368 solaris2.5
http://ftp.sunfreeware.com/ftp/pub/freeware/i386/5.5.1/baggett/gcc-2723-opt.tar.gz
解压之后,里面已经包括了。
/bin
/lib
/info
/i386_unknown_solaris2.6
/man
这些是不是已经编译好的?只需指明PATH,不用再安装了吧?
我直接在~/bashrc上加了这些
PATH=原来的路径/gcc目录/bin
LD_LIBRARY_PATH=/gcc目录/lib/gcc-lib/i386_unknown_solaris2.6/2.7.2.3 -->这里有.a文件和include目录。
改完也都用source命令刷新了。
可是当运行gcc test.c的时候,抱错:
gcc: installation problem, cannot exec `cpp': No such file or directory
而在/gcc目录/lib/gcc-lib/Intel_unknown_solaris2.6/2.7.2.3下面有名为cpp的文件啊?怎么回事?
再有,我的gcc目录是我自己制定的,难道需要放在一个特定的目录下吗?
这个code对我极为重要,我又刚刚开始用solaris和unix,对gcc一窍不通,请各位大侠提供一个具体的解释,谢谢。
gcc的连接就在上面,请各位帮我看一下。
|
$ cpp
直接运行cpp,行吗?
google...
http://vmlinux.org/crash/mirror/www.objsw.com/CrossGCC/FAQ-5.html
http://www.delorie.com/djgpp/v2faq/faq6_5.html
http://gcc.gnu.org/ml/gcc-help/1999-10/msg00177.html
http://www.cygwin.com/ml/cygwin/1997-11/msg00523.html
直接运行cpp,行吗?
google...
http://vmlinux.org/crash/mirror/www.objsw.com/CrossGCC/FAQ-5.html
http://www.delorie.com/djgpp/v2faq/faq6_5.html
http://gcc.gnu.org/ml/gcc-help/1999-10/msg00177.html
http://www.cygwin.com/ml/cygwin/1997-11/msg00523.html
|
试试这招怎么样?把cc1、cc1obj、cc1plus、cpp都copy到gcc目录/bin ?
我觉得下面这段好像值得一试:
5.1 installation problem, cannot exec `cpp': No such file or directory
This error message usually appears when GCC has been installed in a place other than the one it was configured for. There are two solutions:
install GCC in the right place. You can find out where GCC was configured to be installed by running `gcc --print-search-dirs'. It will print something like this:
--------------------------------------------------------------------------------
install: /calvin/dje/rel/H-sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/2.95.2/
programs: [... omitted ...]
libraries: [... omitted ...]
--------------------------------------------------------------------------------
The `install' line tells you where GCC was configured to be installed (in this case /calvin/dje/rel/H-sparc-sun-solaris2).
Set the environment variable GCC_EXEC_PREFIX to the directory where you installed GCC. For example, if you installed GCC in /home/gcc (and file cc1 lives in /home/gcc/lib/gcc-lib/$target/2.95.2 where $target is the --target argument that was passed to configure), then set GCC_EXEC_PREFIX to /home/gcc/lib/gcc-lib/. The trailing `/' is important!
See the GCC info page `Environment Variables' for more information. e.g.
--------------------------------------------------------------------------------
info -f gcc.info -n "Environment Variables"
我觉得下面这段好像值得一试:
5.1 installation problem, cannot exec `cpp': No such file or directory
This error message usually appears when GCC has been installed in a place other than the one it was configured for. There are two solutions:
install GCC in the right place. You can find out where GCC was configured to be installed by running `gcc --print-search-dirs'. It will print something like this:
--------------------------------------------------------------------------------
install: /calvin/dje/rel/H-sparc-sun-solaris2/lib/gcc-lib/sparc-sun-solaris2/2.95.2/
programs: [... omitted ...]
libraries: [... omitted ...]
--------------------------------------------------------------------------------
The `install' line tells you where GCC was configured to be installed (in this case /calvin/dje/rel/H-sparc-sun-solaris2).
Set the environment variable GCC_EXEC_PREFIX to the directory where you installed GCC. For example, if you installed GCC in /home/gcc (and file cc1 lives in /home/gcc/lib/gcc-lib/$target/2.95.2 where $target is the --target argument that was passed to configure), then set GCC_EXEC_PREFIX to /home/gcc/lib/gcc-lib/. The trailing `/' is important!
See the GCC info page `Environment Variables' for more information. e.g.
--------------------------------------------------------------------------------
info -f gcc.info -n "Environment Variables"