平台无关的资源管理 [英] Platform independent resource management

查看:64
本文介绍了平台无关的资源管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在我的二进制文件中嵌入文本文件的方法(例如Windows资源系统).我需要的东西也就是平台无关的(可以在Windows和Linux中使用).我发现Qt资源管理是我所需要的,但我并不热衷于我的应用程序,仅靠Qt就可以了.我还在 http://www.taniwha.com/~paul/res/ ..但它也特定于平台.

I'm looking for a way to embed text files in my binaries (like windows resource system). I need something thats also platform independent (works in windows and linux). I found Qt resource management to be what I need but I'm not keen on my app depending on Qt for this alone. I also found this tool at http://www.taniwha.com/~paul/res/ .. but it is too platform specific.

推荐答案

xxd实用程序可用于创建C源文件,该文件包含二进制blob作为数组(使用-i命令行选项).您可以将其编译为链接到可执行文件的对象.

The xxd utility can be used to create a C source file, containing your binary blobs as an array (with the -i command line option). You can compile that to an object which is linked into your executable.

xxd应该可移植到大多数平台.

xxd should be portable to most platforms.

这篇关于平台无关的资源管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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