是否有与Windows的“资源文件”等同的Linux? [英] Is there a Linux equivalent of Windows' "resource files"?
问题描述
我有一个C库,我使用MinGW32作为Linux的共享对象和Windows的DLL。 API取决于几个数据文件(统计模型),我真的很喜欢使用SO / DLL,因此部署只是一个文件。
看起来我可以通过用 windres
编译的资源文件来实现Windows,但是我必须为Windows编写一些资源处理代码,我仍然坚持在Linux上的文件。
有没有办法在Linux上实现相同的功能?
更好,是否有一个可移植的解决方案?
Linux和其他ELF系统实际上很简单:< a href =http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967 =noreferrer> http://www.linuxjournal.com/content/嵌入文件可执行aka-hello-world-version-5967
OS X具有捆绑包,因此您只需将库构建为框架并将包中的文件。
I have a C library, which I build as a shared object for Linux and a DLL for Windows with MinGW32. The API depends on a couple of data files (statistical models) which I'd really like to roll in with the SO/DLL so that deployment is just one file.
It looks like I can achieve this for Windows with a "resource file" compiled with windres
, but then I've got to write a bunch of resource-handling code for Windows, and I'm still stuck with the files on Linux.
Is there a way to achieve the same functionality on Linux?
Even better, is there a portable solution?
It's actually quite simple on Linux and other ELF systems: http://www.linuxjournal.com/content/embedding-file-executable-aka-hello-world-version-5967
OS X has bundles, so you just build your library as a framework and put the file in the bundle.
这篇关于是否有与Windows的“资源文件”等同的Linux?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!