LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 938|回复: 2

如何改变 libstdc++.so.6 的存放位置

[复制链接]
发表于 2006-11-1 11:35:39 | 显示全部楼层 |阅读模式
问题出现在我使用的一个Toolkit中,每当加载就会出现:
error:while loading shared libraries:libstdc++.so.6:cannot open shared object file:No such file or directory

各位想这个一定很简单,只要找一个libstdc++.so.6然后copy到 /usr/local 下就可以了
但是,我用的是一台虚拟主机,没有权限做这个. faint ~

我有重新编译的权限, 我想知道可不可以在编译的时候指定libstdc++.so.6的位置,这样我就可以放在我自己的Home目录里了? libstdc++.so.6好像是在编译gcc的时候出现的,但我用
./configure --help时没有看到有相关的选项.

以下是gcc 3.4.4的 configure --help
  1. ./configure --help
  2. Usage: configure [options] [host]
  3. Options: [defaults in brackets after descriptions]
  4. Configuration:
  5.   --cache-file=FILE       cache test results in FILE
  6.   --help                  print this message
  7.   --no-create             do not create output files
  8.   --quiet, --silent       do not print `checking...' messages
  9.   --version               print the version of autoconf that created configure
  10. Directory and file names:
  11.   --prefix=PREFIX         install architecture-independent files in PREFIX
  12.                           [/usr/local]
  13.   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  14.                           [same as prefix]
  15.   --bindir=DIR            user executables in DIR [EPREFIX/bin]
  16.   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  17.   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  18.   --datadir=DIR           read-only architecture-independent data in DIR
  19.                           [PREFIX/share]
  20.   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  21.   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
  22.                           [PREFIX/com]
  23.   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  24.   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  25.   --includedir=DIR        C header files in DIR [PREFIX/include]
  26.   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  27.   --infodir=DIR           info documentation in DIR [PREFIX/info]
  28.   --mandir=DIR            man documentation in DIR [PREFIX/man]
  29.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  30.   --program-prefix=PREFIX prepend PREFIX to installed program names
  31.   --program-suffix=SUFFIX append SUFFIX to installed program names
  32.   --program-transform-name=PROGRAM
  33.                           run sed PROGRAM on installed program names
  34. Host type:
  35.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  36.   --host=HOST             configure for HOST [guessed]
  37.   --target=TARGET         configure for TARGET [TARGET=HOST]
  38. Features and packages:
  39.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  40.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  41.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  42.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  43.   --x-includes=DIR        X include files are in DIR
  44.   --x-libraries=DIR       X library files are in DIR
  45. --enable and --with options recognized:
  46.   --enable-serial-[{host,target,build}-]configure
  47.                           Force sequential configuration of
  48.                           sub-packages for the host, target or build
  49.                           machine, or all sub-packages
  50.   --enable-maintainer-mode enable make rules and dependencies not useful
  51.                           (and sometimes confusing) to the casual installer
复制代码
发表于 2006-11-1 14:52:30 | 显示全部楼层
可以用一下LD_PRELOAD这个环境变量
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-11-1 16:00:07 | 显示全部楼层
由于我不是一个Shell 脚本,而是一个 Web 脚本,所以设置 LD_PRELOAD 没有用.

一旦程序运行了,就没有办法设置 Lib 的目录了,所以我就想在编译的时候做.但对Linux架构还是不熟悉, 不知道是否可以实现.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表