在我的盒子里,我们以 root 用户身份安装了 GCC 4.1.2,但要编译 LLVM 和 clang,我需要更高版本的 GCC。所以我在我的本地目录中下载并安装了 GCC 4.5.0。
如何使现有程序引用 GCC 4.5.0 库和包含。
> gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-46)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> which gcc
/usr/bin/gcc
> setenv PATH gcc-4.5.0/bin/gcc/gcc-4.5.0/bin:$PATH
> gcc --version
gcc (GCC) 4.5.0
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> which gcc
gcc-4.5.0/bin/gcc/gcc-4.5.0/bin/gcc
只是设置系统 PATH 对我有帮助,还是我需要为现有代码做任何其他事情来引用 GCC 4.5.0 套件?
gcc-4.5.0/bin/gcc/gcc-4.5.0/> ls -l
total 24
drwxrwxr-x 2 prasad ppusers 4096 Jun 13 21:32 bin
drwxrwxr-x 3 prasad ppusers 4096 Jun 13 21:32 include
drwxrwxr-x 3 prasad ppusers 4096 Jun 13 21:32 lib
drwxrwxr-x 2 prasad ppusers 4096 Jun 13 21:32 lib64
drwxrwxr-x 3 prasad ppusers 4096 Jun 13 21:32 libexec
drwxrwxr-x 6 prasad ppusers 4096 Jun 13 21:32 share