Stop dllexport functions in .lib from getting export from DLL

I have a copy of the axtls library that I put together in a static library. I am linking it to the DLL I'm creating, and some of the axtls functions ( _MD5_Final , _MD5_Init and _MD5_Update ) seem to be exported from my DLL. I'm trying to figure out how to stop this.

My DLL is built with a .def file that does not list any of these functions. However, they are all declared as __declspec(dllexport) in axtls itself, so I suspect that is why they are exported.

I was wondering if there is a way to block the export of these functions using a .def file or similar? My DLL will be used as part of the public SDK, so itโ€™s not particularly good to exhibit internal functions like this.

I suspect that removing __declspec(dllexport) from the definitions in axtls might solve my problem, but I would prefer not to change the modifier code if I can avoid it.

+4
source share
1 answer

Whenever you have a static LIB file and all exported functions in a DLL that uses this LIB file to build, the solution is simple:

Recompile the static LIB project without __declspec(dllexport) , and then recompile the DLL project.

With a DEF file, you cannot do this.

0
source

Source: https://habr.com/ru/post/1469024/


All Articles