Proper way to link static libraries with dll
Static libraries should not contain any __declspec or __attribute((dll...)) things. They are nothing more than multiple object files (usually *.obj or *.o), composed into one, single file.
`When your DLL refers to an external content (like function or variable), it is resolved at linking time - together with all dependencies. But that’s all. If your static library has a function named print_sample_string(), but your DLL does not use it, it won’t be attached to DLL image. Think about this carefully - why should it be?Even more - functions, that are not dllexported explicitly won’t be visible anyway. Functions have by default external storage - so basically, they are private DLL’s content.`
Why cannot I __declspec(dllexport) a function from a static library?
Export all symbols when creating a DLL
warning C4251: needs to have dll-interface to be used by clients of class [duplicate]
Exporting classes containing std:: objects (vector, map, etc) from a dll