如何将 Allegro 库与 Ubuntu Allegro 应用程序捆绑在一起?
我获得了 Allegro 开发库,编写并编译了一个简单的应用程序,并在我的计算机上运行它,它运行良好。我有一个朋友测试过,但双击时没有任何反应。我认为问题是他没有安装 Allegro 库,所以程序无法运行。手动安装库和依赖项是让他工作的唯一方法,还是有某种方法将必要的库与应用程序打包在一起?
编辑:抱歉,我的意思是我正在使用 Allegro 5。
I got the Allegro dev libraries, wrote and compiled a simple application, and ran it on my computer, and it worked fine. I had a friend test it, but it did not do anything when double clicked. I think the problem is that he does not have the Allegro library installed, so the program doesn't work. Is the only way to make it work for him to manually install the library and dependencies, or is there some way to package the necessary libraries with the application?
EDIT: Sorry, I meant to say I was using Allegro 5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在使用 Allegro 4,因为您正在使用 Ubuntu 软件包。如果是这样,您可以链接静态 liballeg.a 库。但是,仍然存在其他依赖项。
在可执行文件上运行 ldd 将显示需要哪些依赖项。如果你的朋友运行 ldd,它会告诉他缺少哪些依赖项。
编辑:由于您使用的是 Allegro 5,因此您需要编译静态版本。从新的构建目录:
然后构建时:
再次,还会有其他依赖项,但您的朋友可以使用 apt-get 安装它们。
I assume you are using Allegro 4 since you are working with Ubuntu packages. If so, you can link against the static liballeg.a library. However, there are still additional dependencies.
Running ldd on your executable will show which dependencies are required. If your friend runs ldd, it will tell him which dependencies are missing.
Edit: Since you are using Allegro 5, you would need to compile the static version. From a fresh build directory:
Then when building:
And again, there will be other dependencies, but your friend could just install them with
apt-get
.