libgcc_s.so.1的定义位置

问题描述 投票:1回答:1

首先,我在没有SUDO权限的情况下使用Debian VPS,无法安装任何东西。

我想运行程序:

./program

它通知我它需要libgcc_s.so.1:

ERROR: ld.so: object '/lib/snoopy.so' from /etc/ld.so.preload cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
./program: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory

我的问题是,有没有一种方法无需安装gcc-multilib(无需sudo)即可运行程序?我以为也许可以在本地下载gcc-multilib并指定执行路径,但是我不知道如何。

linux dependencies debian libgcc
1个回答
0
投票

取决于编译程序的方式以及运行该程序的系统,您应该能够使用LD_LIBRARY_PATH告诉系统在特定目录中加载/查找其他库。

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/

来自manpage of ld.so

LD_LIBRARY_PATH

          A list of directories in which to search for ELF libraries at
          execution time.  The items in the list are separated by either
          colons or semicolons, and there is no support for escaping
          either separator.

          This variable is ignored in secure-execution mode.

          Within the pathnames specified in LD_LIBRARY_PATH, the dynamic
          linker expands the tokens $ORIGIN, $LIB, and $PLATFORM (or the
          versions using curly braces around the names) as described
          above in Rpath token expansion.  Thus, for example, the fol‐
          lowing would cause a library to be searched for in either the
          lib or lib64 subdirectory below the directory containing the
          program to be executed:

              $ LD_LIBRARY_PATH='$ORIGIN/$LIB' prog

          (Note the use of single quotes, which prevent expansion of
          $ORIGIN and $LIB as shell variables!)

从错误消息中可以看出,您似乎正在尝试在64位系统上运行32位二进制文​​件。添加正确的32位库应该可以运行程序。

另一种选择是“简单地”为64位系统编译您的二进制文件。但是,如果您不在本机64位系统上,则可能会出现问题,并且可能会迫使您选择cross compile

© www.soinside.com 2019 - 2024. All rights reserved.