• <small id='UMCpz'></small><noframes id='UMCpz'>

  • <tfoot id='UMCpz'></tfoot>
    <legend id='UMCpz'><style id='UMCpz'><dir id='UMCpz'><q id='UMCpz'></q></dir></style></legend>

        <bdo id='UMCpz'></bdo><ul id='UMCpz'></ul>
      1. <i id='UMCpz'><tr id='UMCpz'><dt id='UMCpz'><q id='UMCpz'><span id='UMCpz'><b id='UMCpz'><form id='UMCpz'><ins id='UMCpz'></ins><ul id='UMCpz'></ul><sub id='UMCpz'></sub></form><legend id='UMCpz'></legend><bdo id='UMCpz'><pre id='UMCpz'><center id='UMCpz'></center></pre></bdo></b><th id='UMCpz'></th></span></q></dt></tr></i><div id='UMCpz'><tfoot id='UMCpz'></tfoot><dl id='UMCpz'><fieldset id='UMCpz'></fieldset></dl></div>

      2. .def 文件 C/C++ DLL

        时间:2023-08-29
        <i id='CWSEm'><tr id='CWSEm'><dt id='CWSEm'><q id='CWSEm'><span id='CWSEm'><b id='CWSEm'><form id='CWSEm'><ins id='CWSEm'></ins><ul id='CWSEm'></ul><sub id='CWSEm'></sub></form><legend id='CWSEm'></legend><bdo id='CWSEm'><pre id='CWSEm'><center id='CWSEm'></center></pre></bdo></b><th id='CWSEm'></th></span></q></dt></tr></i><div id='CWSEm'><tfoot id='CWSEm'></tfoot><dl id='CWSEm'><fieldset id='CWSEm'></fieldset></dl></div>

        <small id='CWSEm'></small><noframes id='CWSEm'>

          <tfoot id='CWSEm'></tfoot>
            <tbody id='CWSEm'></tbody>
            <legend id='CWSEm'><style id='CWSEm'><dir id='CWSEm'><q id='CWSEm'></q></dir></style></legend>
              • <bdo id='CWSEm'></bdo><ul id='CWSEm'></ul>

                1. 本文介绍了.def 文件 C/C++ DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我不明白将 .def 文件与 DLL 一起使用的意义.

                  I am not understanding the point of using .def files with DLLs.

                  它似乎取代了在您的 DLL 代码中使用显式导出的需要(即显式 __declspec(dllexport)),但是我无法在不使用这些时生成 lib 文件,然后在使用 DLL 时创建链接器问题.

                  It seems that it replaces the need to use explicit exports within your DLL code (ie. explicit __declspec(dllexport)) however I am unable to generate a lib file when not using these which then creates linker issues later when using the DLL.

                  那么在与客户端应用程序链接时如何使用 .defs,它们是否取代了使用头文件或 .lib 文件的需要?

                  So how do you use .defs when linking with the client application, do they replace the need to use a header or .lib file?

                  推荐答案

                  我的理解是 .def 文件提供了 __declspec(dllexport) 语法的替代方案,具有能够显式指定导出的序数的额外好处职能.如果您仅按序数导出某些函数,这会很有用,这不会显示有关函数本身的太多信息(例如:许多操作系统内部 DLL 的导出函数仅按序数).

                  My understanding is that .def files provide an alternative to the __declspec(dllexport) syntax, with the additional benefit of being able to explicitly specify the ordinals of the exported functions. This can be useful if you export some functions only by ordinal, which doesn't reveal as much information about the function itself (eg: many of the OS internal DLL's export functions only by ordinal).

                  请参阅参考页.

                  请注意,.def 文件中的名称必须与二进制文件中的名称匹配.因此,如果您将 C 或 C++ 与 'extern "C" { ... }' 一起使用,名称将不会被破坏;否则,您必须为用于生成 DLL 的编译器的特定版本使用正确的重整名称.__declspec() 函数会自动完成这一切.

                  Note that the names in the .def file must match the names in the binary. So if you using C or C++ with 'extern "C" { ... }', the names will not be mangled; otherwise you must use the correct mangled names for the specific version of the compiler used to generate the DLL. The __declspec() function does this all automatically.

                  这篇关于.def 文件 C/C++ DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:AllocConsole() 不显示 cout 下一篇:Excel VBA,无法从 DLL 文件中找到 DLL 入口点

                  相关文章

                2. <legend id='wDFbN'><style id='wDFbN'><dir id='wDFbN'><q id='wDFbN'></q></dir></style></legend>
                  • <bdo id='wDFbN'></bdo><ul id='wDFbN'></ul>

                  <tfoot id='wDFbN'></tfoot>
                  <i id='wDFbN'><tr id='wDFbN'><dt id='wDFbN'><q id='wDFbN'><span id='wDFbN'><b id='wDFbN'><form id='wDFbN'><ins id='wDFbN'></ins><ul id='wDFbN'></ul><sub id='wDFbN'></sub></form><legend id='wDFbN'></legend><bdo id='wDFbN'><pre id='wDFbN'><center id='wDFbN'></center></pre></bdo></b><th id='wDFbN'></th></span></q></dt></tr></i><div id='wDFbN'><tfoot id='wDFbN'></tfoot><dl id='wDFbN'><fieldset id='wDFbN'></fieldset></dl></div>

                  <small id='wDFbN'></small><noframes id='wDFbN'>