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

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

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

      <tfoot id='JXrIu'></tfoot>

      <i id='JXrIu'><tr id='JXrIu'><dt id='JXrIu'><q id='JXrIu'><span id='JXrIu'><b id='JXrIu'><form id='JXrIu'><ins id='JXrIu'></ins><ul id='JXrIu'></ul><sub id='JXrIu'></sub></form><legend id='JXrIu'></legend><bdo id='JXrIu'><pre id='JXrIu'><center id='JXrIu'></center></pre></bdo></b><th id='JXrIu'></th></span></q></dt></tr></i><div id='JXrIu'><tfoot id='JXrIu'></tfoot><dl id='JXrIu'><fieldset id='JXrIu'></fieldset></dl></div>
      1. 如何在 Windows 上为 NetBeans 和 gcc 添加库包含路径?

        时间:2023-08-27
        <tfoot id='91V1M'></tfoot>

              • <bdo id='91V1M'></bdo><ul id='91V1M'></ul>
                  <legend id='91V1M'><style id='91V1M'><dir id='91V1M'><q id='91V1M'></q></dir></style></legend>

                  <small id='91V1M'></small><noframes id='91V1M'>

                    <tbody id='91V1M'></tbody>

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

                  本文介绍了如何在 Windows 上为 NetBeans 和 gcc 添加库包含路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 Windows 上为 NetBeans 和 gcc 添加库包含路径?

                  How to add a library include path for NetBeans and gcc on Windows?

                  使用:

                  • NetBeans 7.1.2
                  • MinGW (mingw-get-inst-20120426.exe)
                  • gcc 4.7.0

                  推荐答案

                  比如你想把C:Program Files (x86)Example1.0include中的目录添加为包含路径.

                  For example, you want to add the directories in C:Program Files (x86)Example1.0include as the include paths.

                  首先设置代码辅助:

                  • NetBeans > 工具 > 选项 > C/C++ > 代码帮助
                    • C 编译器 > 包含目录:
                      • C:Program Files (x86)Example1.0includeshared
                      • C:Program Files (x86)Example1.0includeother
                      • C:Program Files (x86)Example1.0include
                      • C:MinGWlibgccmingw324.7.0include
                      • C:MinGWinclude
                      • C:MinGWlibgccmingw324.7.0include-fixed
                      • ...
                      • C:Program Files (x86)Example1.0includeshared
                      • C:Program Files (x86)Example1.0includeother
                      • C:Program Files (x86)Example1.0include
                      • C:MinGWlibgccmingw324.7.0includec++
                      • C:MinGWlibgccmingw324.7.0includec++mingw32
                      • C:MinGWlibgccmingw324.7.0includec++ackward
                      • C:MinGWlibgccmingw324.7.0include
                      • C:MinGWinclude
                      • C:MinGWlibgccmingw324.7.0include-fixed
                      • ...

                      C:MinGW... 目录只是示例.不要实际添加它们.NetBeans 应该已经自动检测并添加了 MinGW 目录.如果没有,请尝试重置设置:

                      The C:MinGW... directories are examples only. Do not actually add them. NetBeans should have detected and added the MinGW directories automatically. If not, try resetting the settings:

                      • NetBeans > 工具 > 选项 > C/C++
                        • 代码帮助
                          • C 编译器 > 重置设置
                          • C++ 编译器 > 重置设置
                          • 恢复默认设置

                          有关现有源代码自动辅助的说明,请参阅:

                          For instructions on automatic code assistance for existing sources, see:

                          • C/C++ 项目快速入门教程:

                          • C/C++ Projects Quick Start Tutorial:

                          http://netbeans.org/kb/docs/cnd/quickstart.html#makefileprojects

                          如何在从现有代码创建项目时配置代码辅助:

                          How to Configure Code Assistance When Creating a Project from Existing Code:

                          http://netbeans.org/kb/docs/cnd/配置代码协助.html

                          现在,配置项目选项:

                          • 右键单击项目 > 属性
                            • 配置:<所有配置>
                            • 构建
                              • C 编译器
                                • 一般
                                  • 包括目录:
                                    • C:Program Files (x86)Example1.0includeshared
                                    • C:Program Files (x86)Example1.0includeother
                                    • C:Program Files (x86)Example1.0include
                                    • 其他选项:
                                      • -std=c11 -g3 -pedantic -Wall -Wextra -O0
                                      • 一般
                                        • 包括目录:
                                          • C:Program Files (x86)Example1.0includeshared
                                          • C:Program Files (x86)Example1.0includeother
                                          • C:Program Files (x86)Example1.0include
                                          • 其他选项:
                                            • -std=c++11 -g3 -pedantic -Wall -Wextra -O0

                                            要为所有项目默认添加命令行选项,请参阅:

                                            For adding command-line options by default for all projects, see:

                                            • GCC 的 NetBeans 设置

                                            路径中的任何空格都应自动转义.任何反斜杠都应自动替换为正斜杠.

                                            Any spaces in the path should be automatically escaped. Any backward slashes should be replaced with forward slashes automatically.

                                            例如,其他选项"中的所有选项"文本框如下所示:

                                            For example, the "All options" textbox in "Additional Options" looks like this:

                                            -std=c11 -g3 -pedantic -Wall -Wextra -O0 -g -I/C/Program Files (x86)/Example/1.0/include/shared -I/C/Program Files (x86)/Example/1.0/include/other -I/C/Program Files (x86)/Example/1.0/include
                                            

                                            如果这不起作用,您可能需要修复路径并在附加选项中手动添加包含.例如,将 /C/ 替换为 C:/.

                                            If this does not work, you may have to fix the path and add the includes manually in the additional options. For example, replace /C/ with C:/.

                                            -std=c11 -g3 -pedantic -Wall -Wextra -O0 -g -IC:/Program Files (x86)/Example/1.0/include/shared -IC:/Program Files (x86)/Example/1.0/include/other -IC:/Program Files (x86)/Example/1.0/include
                                            

                                            如果您正在使用 Cygwin make 并且如果您尝试在命令中使用冒号清理或重建项目,您可能会得到 *** 多个目标模式.停止. 错误信息.根据 多目标模式? 和 非常简单的应用程序因多目标模式"而失败;来自 Eclipse,make 在路径中看到 : 并认为它是另一个目标定义,因此出现错误."

                                            If you are using Cygwin make and if you try to clean or rebuild the project with colons in the command, you may get a *** multiple target patterns. Stop. error message. According to the answers from Multiple target patterns? and Very simple application fails with "multiple target patterns" from Eclipse, "make sees the : in the path and thinks it is another target definition, hence the error."

                                            解决方法是在每次构建项目之前删除生成的 builddist 文件夹.但是,这可能很烦人,因此您可以尝试改为尝试 MinGW MSYS make(不要与 MinGW make 混淆,后者是 不支持).

                                            The workaround is to delete the generated build and dist folders every time before you build your project. However, this can be annoying, so you could try MinGW MSYS make instead (not to be confused with MinGW make, which is unsupported).

                                            有关 MinGW 和 MSYS 配置说明,请参阅:

                                            For MinGW and MSYS configuration instructions, see:

                                            • 为 C/C++/Fortran 配置 NetBeans IDE:

                                            • Configuring the NetBeans IDE for C/C++/Fortran:

                                            http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw

                                            要使用 MinGW 和 Unicode,您应该安装最新版本的 MinGW-w64.见:

                                            For working with MinGW and Unicode, you should install the latest version of MinGW-w64. See:

                                            • wWinmain、Unicode 和 Mingw

                                            这篇关于如何在 Windows 上为 NetBeans 和 gcc 添加库包含路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Netbeans IDE 7.2.1:如何添加 c++ boost 库 下一篇:Qt Designer,缺少“转到插槽"在上下文菜单中?

                  相关文章

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

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

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

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

                      <tfoot id='gymfH'></tfoot>