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

      <tfoot id='BOFbS'></tfoot>

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

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

      GCC 相当于 MS 的/bigobj

      时间:2023-06-29
    2. <small id='reh6S'></small><noframes id='reh6S'>

        <bdo id='reh6S'></bdo><ul id='reh6S'></ul>
      • <tfoot id='reh6S'></tfoot>

                <legend id='reh6S'><style id='reh6S'><dir id='reh6S'><q id='reh6S'></q></dir></style></legend>
                  <tbody id='reh6S'></tbody>
              1. <i id='reh6S'><tr id='reh6S'><dt id='reh6S'><q id='reh6S'><span id='reh6S'><b id='reh6S'><form id='reh6S'><ins id='reh6S'></ins><ul id='reh6S'></ul><sub id='reh6S'></sub></form><legend id='reh6S'></legend><bdo id='reh6S'><pre id='reh6S'><center id='reh6S'></center></pre></bdo></b><th id='reh6S'></th></span></q></dt></tr></i><div id='reh6S'><tfoot id='reh6S'></tfoot><dl id='reh6S'><fieldset id='reh6S'></fieldset></dl></div>
                本文介绍了GCC 相当于 MS 的/bigobj的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我们正在大量使用 boost::serialization 和一般的模板.一切似乎都很顺利.

                We are making heavy use of boost::serialization and templates in general. All seems to be going well.

                除此之外,我们在 Windows 版本上遇到了障碍.这似乎会导致目标文件过大的问题.我们正在使用带有 g++ 4.7.0 的 MinGW/Msys.

                Except, we've hit a snag on our Windows builds. It seems to cause issues in the object files being too large. We're using MinGW/Msys with g++ 4.7.0.

                c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/as.exe: CMakeFiles/source.dir/sourcecode.cpp.obj: too many sections (33396)
                C:UsersusernameAppDataLocalTempccnAocvD.s: Assembler messages:
                C:UsersusernameAppDataLocalTempccnAocvD.s: Fatal error: can't write CMakeFiles/source.dir/sourcecode.cpp.obj: File too big
                

                谷歌大师透露了这条存档消息,http://sourceforge.net/mailarchive/forum.php?thread_name=CA%2Bsc5mkLvj%3DW9w2%3DsY%3Dc_N%3DEwnsQuPDEX%3DiBcbsbxS34C0mail_5Bg;=mingw-用户

                Master google revealed this archived message, http://sourceforge.net/mailarchive/forum.php?thread_name=CA%2Bsc5mkLvj%3DW9w2%3DsY%3Dc_N%3DEwnsQuPDEX%3DiBcbsbxS3CuE_5Bg%40mail.gmail.com&forum_name=mingw-users

                在其中,它表明另一个人击中了几乎相同的障碍.它确实指向 Visual Studio 的 /bigobj 选项的一个选项,该选项似乎可以满足我们的需要.但是,我们无法迁移到 Visual Studio.

                In it, it indicates that another person hit pretty much the same snag. It did point to an option for Visual Studio's /bigobj option which appears to do what we would need. However, we're unable to move to Visual Studio.

                一个建议是将 --hash-size 添加到汇编器选项中.这没有帮助.

                One suggestion was to add --hash-size to the assembler options. This did not help.

                如果我没记错的话,问题在于目标文件中的条目限制为 2^16 个.实际上,根据错误消息,我敢说这是一个签名的 2^16 条目,但那是花生.Visual Studio 的 /bigobj 选项会将其更改为 2^32.邮件列表结果不知道 GCC 的等效选项.进一步的谷歌结果似乎与此无关.

                If I'm not mistaken, the issue lies in the fact that the object files have a limit of 2^16 entries in them. Actually, according to the error message, I would venture that it's a signed 2^16 entries, but that's peanuts. The /bigobj option for Visual Studio would change that to 2^32. The mailing list result did not know of an equivalent option for GCC. Further google results don't appear to be relevant to this.

                此时我们将不得不重构我们的代码(呃)来解决这个限制.但我仍然担心,如果使用繁重的模板,我们可能会一次又一次地遇到这个问题(我们已经用三个源文件遇到了这个问题).

                At this point we'll have to refactor our code (ugh) to get around this limitation. But I am still concerned that, with heavy templating, we could run into the issue again and again (we've already run into it with three source files).

                所以我的问题是这样的;是否有等效于 Microsoft /bigobj 选项的 GCC?我还没有找到第三个选项吗?

                So my question is thus; is there a GCC equivalent to Microsoft's /bigobj option? Is there a third option that I'm not yet found?

                推荐答案

                解决方案是添加选项 -Wa,-mbig-obj 如果您的 GCC 版本支持该选项.您可能只在编译步骤中需要它,而不是在链接器步骤中.

                The solution is to add the option -Wa,-mbig-obj if your version of GCC supports that option. You probably only need it during the compilation step, not the linker step.

                如果您的编译器不支持该选项,您应该考虑使用 mingw-w64 和 MSYS2.

                If your compiler does not support that option, you should look into using mingw-w64 and MSYS2.

                这篇关于GCC 相当于 MS 的/bigobj的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:如何使用 shared_ptr 避免内存泄漏? 下一篇:安全地取消 boost asio 截止时间计时器

                相关文章

                      <bdo id='8g0aQ'></bdo><ul id='8g0aQ'></ul>
                  1. <small id='8g0aQ'></small><noframes id='8g0aQ'>

                  2. <legend id='8g0aQ'><style id='8g0aQ'><dir id='8g0aQ'><q id='8g0aQ'></q></dir></style></legend>
                  3. <tfoot id='8g0aQ'></tfoot>
                    <i id='8g0aQ'><tr id='8g0aQ'><dt id='8g0aQ'><q id='8g0aQ'><span id='8g0aQ'><b id='8g0aQ'><form id='8g0aQ'><ins id='8g0aQ'></ins><ul id='8g0aQ'></ul><sub id='8g0aQ'></sub></form><legend id='8g0aQ'></legend><bdo id='8g0aQ'><pre id='8g0aQ'><center id='8g0aQ'></center></pre></bdo></b><th id='8g0aQ'></th></span></q></dt></tr></i><div id='8g0aQ'><tfoot id='8g0aQ'></tfoot><dl id='8g0aQ'><fieldset id='8g0aQ'></fieldset></dl></div>