Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Platform independent resource management [duplicate]

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.

like image 850
Nithin Avatar asked Nov 01 '09 11:11

Nithin


2 Answers

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 should be portable to most platforms.

like image 175
caf Avatar answered Sep 29 '22 18:09

caf


If you're using QT 4.5, you can make sure that program is only dependent on one small piece of QT, such as libqtcore. QResource is a part of libqtcore.

like image 23
supercheetah Avatar answered Sep 29 '22 17:09

supercheetah