My project builds through few static libraries which should linked to main dll library gain one single dll as a result.
Using __declspec(dllexport)
attribute does not lead to appearance of specified functions of static libraries to dll, libraries not linked with dll at all.
Then I tried to build each library as shared for getting proper names of exported functions and created .def file based on them. Using .def file leaded to result.
Should
__declspec(dllexport)
and.def-file
act equally in my case?Is it possible to generate a .def file from sources? Since I have C++ code I'm not able to write .def file by myself because of mangling and presence classes in API, the approach described above with temporary generated dlls is inconsistent for production.
Update
I'd like to explain in detail about the structure of my project. The solution consists of a few projects (modules).
+
|
+-+ static_lib1
| +
| +--+ src
|
+-+ static_lib2
| +
| +--+ src
|
+-+ dynamic_lib (linked with static_lib1 and static_lib2)
+
+--+ src
Each sub-project weakly depends on others, let's assume they are not connected for clearness. Each module has own public interface. I want to have all modules as single dynamic library so my artifact is dynamic_lib.dll
, but in fact static libraries are not linked with it.
[...] libraries not linked with dll at all
. Did you get an error indynamic_lib
or another project, that is using dynamic_lib? Was this error anunresolved external [...]
? – Ephodunresolved external
when trying to use dll library in an external prodjects – Ezekielezell