【问题标题】:skipping incompatible lib_share.so when searching for -lMY_LIB cannot find -lMY_LIB搜索 -lMY_LIB 时跳过不兼容的 lib_share.so 找不到 -lMY_LIB
【发布时间】:2013-10-25 14:36:52
【问题描述】:

我正在尝试从退出的 MY_LIB.so 文件构建 lib_share.so 文件。 MY_LIB.so 文件位于 my_path 中。

g++ -shared -o lib_share.so -L/my_path -lMYLIB 

当我跑步时,它给了我一个休闲错误

bin/ld: skipping incompatible /home/folder/lMY_LIB.so 

搜索 -lMY_LIB 时

/home/../../bin/ld: cannot find -lMY_LIB

P.S.:MY_LIB.so 是软链接

当我转到 main .so 文件并在 main .so 中搜索 MY_LIB 时,它给出如下。

objdump -p MY_LIB.so.1.0.1 | grep 
MY_LIB.so.1.0.1:     file format **elf32-big**
  SONAME               MY_LIB.so.1

库文件格式为32bit,我使用64位机编译 (g++ -shared -o lib_share.so -L/my_path -lMYLIB)

任何人都可以帮助理解为什么我无法编译(g++ -shared -o lib_share.so -L/my_path -lMYLIB),即使 MY_LIB 实际存在于它的目录中

根据我的谷歌搜索,这是因为库是 32 位的,我使用 64 位机器来编译程序。

谁能给出任何其他错误的可能性以及如何解决这个错误。

【问题讨论】:

    标签: c makefile static-libraries symlink dynamic-library


    【解决方案1】:

    尝试使用g++-m32标志来编译整个32位程序。

    【讨论】:

      猜你喜欢
      • 2013-06-09
      • 1970-01-01
      • 1970-01-01
      • 2013-05-31
      • 2021-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-18
      相关资源
      最近更新 更多