1

I'm trying to code a dll as a plugin for some system using C++. This plugin will make use of another library which is a .lib file and should output only one .dll file as a result. So I want this other .lib file included in my dll. There should be only one dll file and lib file should be included in it, so that I could include this dll file into the system as a one-file plugin. Is this possible and how?

I'm using Visual C++ 2010 Express.

Thank you.

Hakan
  • 756
  • 1
  • 8
  • 17
  • I edited the question a bit. What I want is just a dll file that includes the lib. I will import that dll file into the other system as a plugin. I try to link it in, but the resulting dll file doesn't seem to include lib. Maybe I'm doing something wrong. – Hakan Jan 05 '15 at 11:18

1 Answers1

2

Unfortunately, the VS linker doesn't have an option equivalent to ld's --whole-archive which can be used to include an entire library.

Your best bet is to unpack the library and link in the resulting object files. You can use the librarian (lib tool) for that. To list all members of the library, use lib /LIST. Object files have to be extracted one by one, using lib /EXTRACT:member.

Angew is no longer proud of SO
  • 167,307
  • 17
  • 350
  • 455