SupaGu
SupaGu

Reputation: 619

Force all symbols to be exported to DLL from linked lib file

In Visual studio 2012 have a DLL project, that pulls in a number of lib files. The code within the lib files has the appropriate __declspec(dllexport) applied to functions and classes. The problem is, visual studio does not pull in all exports from the lib file. It will only pull in obj's form the lib file that are required.

This means, currently I have a dummy function in my DLL project that just references the functions to ensure the obj is pulled in.

Now, is there a way I can get visual studio to supply include all obj's from the lib's so I do not need this dummy method?

Upvotes: 1

Views: 1647

Answers (1)

SHR
SHR

Reputation: 8313

If I understood correctly, you've got several static libs, and you want to join them all to a DLL.

when you compiled the libraries it was compiled as static lib.

A static lib symbols are included only if been used.

I think your best solution is to try to use def file, bot it is not good for classes. Look here: Exporting from a DLL Using DEF Files

Upvotes: 1

Related Questions