Our team is considering to move from def file to __declspec(dllexport) macro because it has to use mangling name in the *.def
files and, that is a tedious task to maintain those ugly looking names there. But we are still doubt is there any benefit from using *.def file over __declspec(dllexport) macro for function export.
Appreciate your suggestions!
Def files are a better solution. Help avoid a lot of deployment and backward compatibility problems. Also from the point of view of code maintenance is easier, since you see all the exports in a single place. The "mangling name" problem is easily avoided by adding the extern "C" in the function declaration. Another consideration is that declspec export export the function with the name mangled, a third party consumer, will need to use the exact same compiler you used, and/or.get lib files that are tighly coupled.to your linker.