无法识别共享库文件格式

发布于 2024-09-08 14:17:36 字数 216 浏览 1 评论 0原文

我正在使用共享库。我用它来交叉编译我的可执行文件。在链接阶段,链接器会抛出文件格式无法识别的错误。

当我在 libcclass.so 上运行 ld 时:文件无法识别:文件格式无法识别 当我运行文件 libcclass.so: 时,它给出 libcclass.so: ELF 64-bit LSB Shared object, x86-64, version 1 (SYSV), not stripped

I am using a shared library. Which I am using it to cross compile my executable. During the linking stage linker throws the error file format not recognised.

When I run ld on it libcclass.so: file not recognized: File format not recognized
When I run file libcclass.so: it gives libcclass.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), not stripped

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一曲琵琶半遮面シ 2024-09-15 14:17:37

如果您要交叉编译可执行文件,则还需要交叉编译它所依赖的所有共享库,并链接到这些库。例如,您无法将 i386 可执行文件链接到 x86_64 共享库。

If you're cross-compiling an executable, you also need to cross-compile all of the shared libraries it depends on, and link against those. For example, you can't link an i386 executable to an x86_64 shared library.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文