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

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

    <legend id='aukXX'><style id='aukXX'><dir id='aukXX'><q id='aukXX'></q></dir></style></legend>
        <tfoot id='aukXX'></tfoot>

        Visual Studio 中的 GCC 风格弱链接?

        时间:2023-09-19
        1. <i id='iwd5r'><tr id='iwd5r'><dt id='iwd5r'><q id='iwd5r'><span id='iwd5r'><b id='iwd5r'><form id='iwd5r'><ins id='iwd5r'></ins><ul id='iwd5r'></ul><sub id='iwd5r'></sub></form><legend id='iwd5r'></legend><bdo id='iwd5r'><pre id='iwd5r'><center id='iwd5r'></center></pre></bdo></b><th id='iwd5r'></th></span></q></dt></tr></i><div id='iwd5r'><tfoot id='iwd5r'></tfoot><dl id='iwd5r'><fieldset id='iwd5r'></fieldset></dl></div>
            <legend id='iwd5r'><style id='iwd5r'><dir id='iwd5r'><q id='iwd5r'></q></dir></style></legend>

                <tbody id='iwd5r'></tbody>

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

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

                  <tfoot id='iwd5r'></tfoot>
                  本文介绍了Visual Studio 中的 GCC 风格弱链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  GCC 有能力通过 __attribute__((weak)) 弱化符号链接.我想在用户可以在其应用程序中覆盖的静态库中使用弱符号.GCC 风格的弱符号可以让我这样做,但我不知道是否可以用 Visual Studio 来完成.

                  GCC has the ability to make a symbol link weakly via __attribute__((weak)). I want to use the a weak symbol in a static library that users can override in their application. A GCC style weak symbol would let me do that, but I don't know if it can be done with visual studio.

                  Visual Studio 是否提供类似的功能?

                  Does Visual Studio offer a similar feature?

                  推荐答案

                  MSVC++ 有 __declspec(selectany) 它涵盖了弱符号的部分功能:它允许你定义多个相同的符号与外部链接,指示编译器选择几个可用的任何一个.但是,我认为 MSVC++ 没有任何东西可以涵盖弱符号功能的另一部分:在库中提供可替换"定义的可能性.

                  MSVC++ has __declspec(selectany) which covers part of the functionality of weak symbols: it allows you to define multiple identical symbols with external linkage, directing the compiler to choose any one of several available. However, I don't think MSVC++ has anything that would cover the other part of weak symbol functionality: the possibility to provide "replaceable" definitions in a library.

                  顺便说一句,这让人想知道对标准可替换 ::operator new::operator delete 函数的支持在 MSVC++ 中是如何工作的.

                  This, BTW, makes one wonder how the support for standard replaceable ::operator new and ::operator delete functions works in MSVC++.

                  这篇关于Visual Studio 中的 GCC 风格弱链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 g++ 创建静态库? 下一篇:对静态 const int 的未定义引用

                  相关文章

                  最新文章

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

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

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

                  1. <legend id='SJeI7'><style id='SJeI7'><dir id='SJeI7'><q id='SJeI7'></q></dir></style></legend>
                    1. <tfoot id='SJeI7'></tfoot>