您的位置:首页 > 运维架构 > Linux

关于Linux GCC的路径问题(Include路径, lib 路径)

2009-01-03 00:35 357 查看
前几天遇到一个问题GCC include 路径是怎样设定的 GCC 在执行编译的时候是怎样搜索它的头文件路径的喃? 还有它的LIB文件库的路径? 我问了一个同学,他说的是它自己内部就已经确定的了。 我在想如果我重新安装GCC 它会不会产生覆盖?
我就当它是默认的, 但是我的Gcc遇到了一个问题使我不得不去重新认识gcc的工作。
安装gcc的时候首先要配置, 就是在配置这里, 我终于认清了gcc的路径问题。
当你在bash下输入 gcc -v 的时候它会显示:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=i386-redhat-linux
这个就是你的Gcc的配置文件。在执行 ./configure 后面加上的数据。 看见了“--prefix”了没有, 正是它在影响GCC的执行路径。
下面的是在gcc 安装原码包里面的文件内容:(我挑了几句出来)
--prefix=dirname
Specify the toplevel installation directory. This is the recommended way to install the tools into a directory other than the default. The toplevel installation directory defaults to /usr/local.
--exec-prefix=dirname
Specify the toplevel installation directory for architecture-dependent files. The default is prefix.
--bindir=dirname
Specify the installation directory for the executables called by users (such as gcc and g++). The default is exec-prefix/bin.
--libdir=dirname
Specify the installation directory for object code libraries and internal data files of GCC. The default is exec-prefix/lib.
--libexecdir=dirname
Specify the installation directory for internal executables of GCC. The default is exec-prefix/libexec.
--with-slibdir=dirname
Specify the installation directory for the shared libgcc library. The default is libdir.
--infodir=dirname
Specify the installation directory for documentation in info format. The default is prefix/info.
--datadir=dirname
Specify the installation directory for some architecture-independent data files referenced by GCC. The default is prefix/share.
--mandir=dirname
Specify the installation directory for manual pages. The default is prefix/man. (Note that the manual pages are only extracts from the full GCC manuals, which are provided in Texinfo format. The manpages are derived by an automatic conversion process from parts of the full manual.)
--with-gxx-include-dir=dirname
Specify the installation directory for G++ header files. The default is prefix/include/c++/version.

看清楚了吗? 其它的配置命令我准备把它上来。
如果你看完了你肯定就有所了解了! 如果我说得有什么问题的话,通知我一声。 wushibin1@gmail.com 大家共同进步!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐