我如何知道我的可执行文件是否还将在其他计算机(Linux)上运行? [英] How can I know if my executable will also to run on other computers (linux)?

查看:69
本文介绍了我如何知道我的可执行文件是否还将在其他计算机(Linux)上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可执行文件,希望能够在其他Linux系统中分发和运行. 在没有访问最终运行时环境的情况下,是否有一种方法可以合理地确定这种方法是否有效?

I have an executable I want to be able to distribute and run in other Linux systems. Is there a way to be reasonably sure if this will work, without access to the final runtime environment?

例如,我担心我的可执行文件可能使用仅在我的开发计算机上存在的动态库.

For example, I am concerned my executable could be using a dynamic library that is only present on my development machine.

推荐答案

为可执行文件提供所有相关的共享库,并在外壳脚本中设置$LD_LIBRARY_PATH,该脚本调用可执行文件以告诉链接器在哪里可以找到共享库.有关更多详细信息,请参见ld.so(8)手册页,并确保遵循适当的许可证.

Supply any relevant shared libraries with the executable, and set $LD_LIBRARY_PATH in a shell script that invokes the executable to tell the linker where to find the shared libraries. See the ld.so(8) man page for more details, and be sure to follow the appropriate licenses.

这篇关于我如何知道我的可执行文件是否还将在其他计算机(Linux)上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆