Suppose that we have test.dll
which in fact consists of several static libraries foo.lib
, bar.lib
(they were written in c/c++
and generated by msvc
and have pe/coff
formats).
I want to add functions from foo.lib
, bar.lib
to export table of test.dll
. One of ways to export funcion is declspec(dllexport)
specifier. But unfortunately it does not work for static library (because object files cannot have .edata section and linked dynamically). After compilation and linking we have test.dll
which does not export functions at all. How can I solve this puzzle?
I did some research and I found out that usage of def
file can solve this problem. But as I understand I should manually get list of mangled function names from foo.lib
, bar.lib
and insert the list to def file. It seems like hard way for me, maybe there is better solution?