Ada,如何将Ada代码打包成独立的exe文件?

发布于 2024-12-03 04:13:02 字数 127 浏览 2 评论 0原文

我正在使用GNAT Planning Studio 2011。

我想知道如何将代码打包到exe文件中。 比如将我的代码打包并发布为exe文件,并可以在其他未安装GPS2011的计算机上运行。

谢谢! 阳光明媚

I am use GNAT Programming Studio 2011.

I want to know how package the code to an exe file.
Such as package and release my code to a exe file and could running in other computer which is not install the GPS2011.

Thanks!
Sunny

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

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

发布评论

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

评论(3

风筝在阴天搁浅。 2024-12-10 04:13:02

您可以将 -static 添加到链接器标志中。然后所有共享库将被放入可执行文件中。但别为尺寸而哭泣;)

You can add -static to the linker flags. Then all shared libraries will be put into the executable. But don't cry about the size then ;)

勿忘心安 2024-12-10 04:13:02

当您为项目配置 GPS 时,您告诉它要调用什么以及在哪里放置主程序。

该文件是包含所有代码的“exe”文件(无论是 Windows 中的“.exe”文件,还是其他基于 Unix 的环境中的任何名称)。

如果您的程序使用任何共享库或支持数据或配置文件,则目标计算机必须已经安装这些库,或者需要将它们作为安装包的一部分包含在内。

由于您有“主”exe,因此这只是一个安装打包问题。如果您使用的是 Windows,则有许多可用的安装程序实用程序;对于 Linux,则有各种打包选项,例如 rpm 和 deb。并且始终可以选择简单地提供执行目录层次结构的(压缩的)tar 文件。

When you configured GPS for your project, you told it what to call, and where to place, your main program.

That file is your "exe" file (whether it's literally a ".exe" for Windows, or whatever you named it for other Unix-based environments) containing all your code.

If your program employs any shared libraries or supporting data or configuration files, the target machine will either have to have those already installed, or they'll need to be included as part of your installation package.

Since you have your "main" exe, this then simply becomes an installation packaging question. If you're working on Windows, there's a number of Installer utilities available, and for Linux there's various packaging options, like rpm's and deb's. And there's always the option of simply providing a (compressed) tar file of the execution directory hierarchy.

蓝海 2024-12-10 04:13:02

我更喜欢使用 GNAT 进行开发,但是 MinGW 是准备 .exe 文件的可用替代方法。

附录:请注意 MinGW 源自 FSF GNAT,以及 GNAT 修改版通用公共许可证将适用于使用MinGW编译的代码的分发。在分发使用 GNAT Programming Studio 2011 编译的代码之前,您应该检查副本附带的许可证。您可以在此处找到相关讨论。

I prefer GNAT for development, but MinGW is a usable alternative for preparing .exe files.

Addendum: Note that MinGW derives from FSF GNAT, and the GNAT Modified General Public License would apply to the distribution of code compiled with MinGW. Before distributing code compiled with GNAT Programming Studio 2011, you should check the license that came with your copy. A related discussion may be found here.

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