I am not understanding the point of using .def files with DLLs.
It seems that it replaces the need to use explicit exports within your DLL code (ie. explicit __decls
My understanding is that .def files do not actually specifies which all apis need to be exported. It just contains the apis exported and their ordinal numbers. If you want to actually export a particular api, you need to specify __declspec(dllexport) in the definition of the api and __declspec(dllimport) at the declaration.
The advantage of def file is that, it helps you to maintain the backword compatibility with the already realsed dlls. i.e it maintains the ordinal numbers for apis. Suppose you add a new api in the dll, then the linker looks at your .def file genearate the ordinal number for the ne wapi such that the ordinal numbers for the old apis are intact.
So, if the client code uses the latest dll, it does not break the existing apis.