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

      1. <small id='FO21x'></small><noframes id='FO21x'>

        <legend id='FO21x'><style id='FO21x'><dir id='FO21x'><q id='FO21x'></q></dir></style></legend>
          <bdo id='FO21x'></bdo><ul id='FO21x'></ul>
        <tfoot id='FO21x'></tfoot>

        C++ 如何在 .exe 中编译 dll

        C++ How to compile dll in a .exe(C++ 如何在 .exe 中编译 dll)
        <legend id='jRfU8'><style id='jRfU8'><dir id='jRfU8'><q id='jRfU8'></q></dir></style></legend>

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

              <tbody id='jRfU8'></tbody>

            1. <tfoot id='jRfU8'></tfoot>

                  <bdo id='jRfU8'></bdo><ul id='jRfU8'></ul>

                  <i id='jRfU8'><tr id='jRfU8'><dt id='jRfU8'><q id='jRfU8'><span id='jRfU8'><b id='jRfU8'><form id='jRfU8'><ins id='jRfU8'></ins><ul id='jRfU8'></ul><sub id='jRfU8'></sub></form><legend id='jRfU8'></legend><bdo id='jRfU8'><pre id='jRfU8'><center id='jRfU8'></center></pre></bdo></b><th id='jRfU8'></th></span></q></dt></tr></i><div id='jRfU8'><tfoot id='jRfU8'></tfoot><dl id='jRfU8'><fieldset id='jRfU8'></fieldset></dl></div>
                  本文介绍了C++ 如何在 .exe 中编译 dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在创建一个 C++ 程序,但我希望能够仅向用户提供一个 .exe 文件.但是,我正在使用包含一些 dll 的库(curl 等).是否可以将这些 dll 编译到 .exe 文件中?

                  I am creating a c++ program, but I want to be able to offer just a .exe file to the user. However, I am using libraries (curl among others) which have some dll's. Is it possible to compile these dll's into the .exe file?

                  我使用 Code::Blocks 和 mingw.

                  I use Code::Blocks and mingw.

                  推荐答案

                  为了实现这一点,您需要 静态链接.这要求您的所有库(以及它们递归依赖的库)都需要作为静态库使用.请注意,可执行文件的大小会很大,因为它将携带来自这些静态库的所有代码.这就是为什么首先发明共享库 (DLL) 的原因是为了能够在应用程序之间共享公共代码.然而,这并不总是在 在 Windows 上运行得很好.

                  In order to achieve that you will need static linking. This requires that all your libraries (and the libraries they depend upon recursively) need to be available as static libraries. Be aware that the size of your executable will be large, as it will carry all the code from those static libraries. This is why shared libraries (DLLs) were invented in the first place, to be able to share common code among applications. However that does not always work so well on windows.

                  我认为您可能真正想要的是一个 安装程序 来安装您的可执行文件及其所有依赖项图书馆.

                  I think what you may really want is an installer that installs your executable and all it's dependent libraries.

                  这篇关于C++ 如何在 .exe 中编译 dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                  How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                  Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                  Delay Loading DLLs(延迟加载 DLL)
                  Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                  Loading a dll from a dll?(从 dll 加载 dll?)

                  <legend id='swuvl'><style id='swuvl'><dir id='swuvl'><q id='swuvl'></q></dir></style></legend>

                • <tfoot id='swuvl'></tfoot>
                    <tbody id='swuvl'></tbody>

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

                    • <bdo id='swuvl'></bdo><ul id='swuvl'></ul>

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