0

I have a statically linked library (SLL) which contains resources such as bitmaps, icons, cursors, etc. And functions in the SLL use those resources. And these exported functions are used by my executable. The problem which I was facing earlier was that the resources were not getting included in the executable while linking. However, I got that resolved thanks to another post in StackOverflow which suggested to link the generated .res file as well.

However, I wanted a cleaner solution - wherein I just link the .lib file and the resources get included as well. I did a dumpbin on the .lib file and it seems to contain all the resource data, but while linking those resources are not included in the final binary.

I suspect that lib.exe generates an output with a mangled resource section name (something like .rsrc$01 and .rsrc$02) which the linker does not recognize as a valid resource section name and hence the confusion.

1 Answers1

0

There's a similar question here: VC++ resources in a static library

Seems like your options are to parse the resources so that the library itself provides access to them, or have the library 'build' the resources when it is used.

Community
  • 1
  • 1
Vanwaril
  • 7,380
  • 6
  • 33
  • 47
  • As I had mentioned in my earlier I am aware of the post article which you've mentioned, but I was just looking for a cleaner way. The method mentioned in that post including .lib file as well as .res file which is not what I want. Since the content of the .res file is already there in the .lib file, I was hoping that there would be some way in which I could extract the resource data from the .lib itself. – Subhadeep Ghosh Jan 05 '11 at 04:31
  • That's the third method mentioned, I'm referring to the first and second as feasible options. – Vanwaril Jan 05 '11 at 05:56