3

Possible Duplicate:
Is there a Linux equivalent of Windows' "resource files"?

I am trying to figure out a way of embedding a resource into a static library for linking with C source using the gcc toolchain. The equivalent of a Windows DLL in which resources are embedded. Can this be done with a linux static library?

In short, would for example, doing this cat someresourcedata.txt > mylib.a and to be able to link it with a compiled C code that references mylib.a.

Any ideas or suggestions?

Community
  • 1
  • 1
t0mm13b
  • 34,087
  • 8
  • 78
  • 110

2 Answers2

0

If the data can be represented as text, place it into an include file. Here's an example for how to do this with an XPM image:

/* XPM */
static char * my_xpm_image[] = {
"16 16 15 1",
"       c None",
".      c #000000",
"+      c #7FFFFF",
"@      c #007F7F",
....

And then go about the standard way of creating a static lib (whatever that is - I've not done it, only a dynamic lib and I'm a little rusty on that).

James Morris
  • 4,867
  • 3
  • 32
  • 51
0

*nix does not have the same concept of "resources" that Windows does; they are usually stored as external files, both for executables and libraries.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358