<tfoot id='bpE9q'></tfoot>
    • <bdo id='bpE9q'></bdo><ul id='bpE9q'></ul>
  • <small id='bpE9q'></small><noframes id='bpE9q'>

      <legend id='bpE9q'><style id='bpE9q'><dir id='bpE9q'><q id='bpE9q'></q></dir></style></legend>
        <i id='bpE9q'><tr id='bpE9q'><dt id='bpE9q'><q id='bpE9q'><span id='bpE9q'><b id='bpE9q'><form id='bpE9q'><ins id='bpE9q'></ins><ul id='bpE9q'></ul><sub id='bpE9q'></sub></form><legend id='bpE9q'></legend><bdo id='bpE9q'><pre id='bpE9q'><center id='bpE9q'></center></pre></bdo></b><th id='bpE9q'></th></span></q></dt></tr></i><div id='bpE9q'><tfoot id='bpE9q'></tfoot><dl id='bpE9q'><fieldset id='bpE9q'></fieldset></dl></div>
      1. 我可以将普通文件链接到我的可执行文件中吗?

        时间:2023-09-18

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

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

              <tbody id='A0nk3'></tbody>

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

              <i id='A0nk3'><tr id='A0nk3'><dt id='A0nk3'><q id='A0nk3'><span id='A0nk3'><b id='A0nk3'><form id='A0nk3'><ins id='A0nk3'></ins><ul id='A0nk3'></ul><sub id='A0nk3'></sub></form><legend id='A0nk3'></legend><bdo id='A0nk3'><pre id='A0nk3'><center id='A0nk3'></center></pre></bdo></b><th id='A0nk3'></th></span></q></dt></tr></i><div id='A0nk3'><tfoot id='A0nk3'></tfoot><dl id='A0nk3'><fieldset id='A0nk3'></fieldset></dl></div>
                  <bdo id='A0nk3'></bdo><ul id='A0nk3'></ul>
                • 本文介绍了我可以将普通文件链接到我的可执行文件中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  某些框架(Qt、Windows、Gtk...)提供向二进制文件添加资源的功能.我想知道是否有可能在没有框架的情况下实现,因为真正需要的是

                  Some frameworks (Qt, Windows, Gtk...) offer functionality to add resources to your binaries. I wonder if it would be possible to achieve this without the framework, since all that is really needed is

                  1. 在二进制(数据段)中包含资源地址的符号
                  2. 表示资源长度的符号
                  3. 资源本身

                  如何使用 gcc 工具链实现这一点?

                  How can this be achieved with the gcc toolchain?

                  推荐答案

                  你可以这样做:

                  objcopy --input binary 
                          --output elf32-i386 
                          --binary-architecture i386 my_file.xml myfile.o
                  

                  这会生成一个目标文件,您可以将其链接到您的可执行文件中.此文件将包含您必须在 C 代码中声明的这些符号能够使用它们

                  This produces an object file that you can link into your executable. This file will contain these symbols that you'll have to declare in your C code to be able to use them

                  00000550 D _binary_my_file_xml_end
                  00000550 A _binary_my_file_xml_size 
                  00000000 D _binary_my_file_xml_start
                  

                  这篇关于我可以将普通文件链接到我的可执行文件中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:GNU C++ 如何检查 -std=c++0x 何时生效? 下一篇:如何在 gcc 命令行中定义字符串文字?

                  相关文章

                  最新文章

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

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