Module-definition (.def) files provide the linker with information about exports, attributes, and other information about the program to be linked. A .def file is most useful when building a DLL. Because there are linker options that can be used instead of module-definition statements, .def files are generally not necessary. You can also use __declspec(dllexport) as a way to specify exported functions.
http://msdn.microsoft.com/en-us/library/28d6s79h%28VS.80%29.aspx
我想知道,我们应该更喜欢.def 方式吗?或 dllexport 方式?
最佳答案
模块定义 (.def) 文件为我们提供了更大的灵 active 来定义数据的导出方式。
例如导出的函数可以是匿名的(用序号标识),防止没有声明信息的人使用。
它还可以 ddo 函数转发/重定向,如下所述:
http://msdn.microsoft.com/en-us/library/hyx1zcd3(v=VS.80).aspx
关于visual-c++ - 从 DLL 导出函数 - 使用 DEF 文件或 dllexport?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3314941/