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

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

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

      Netbeans:如何包含其他 C++ 静态库项目?

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

        <legend id='m1K8x'><style id='m1K8x'><dir id='m1K8x'><q id='m1K8x'></q></dir></style></legend>
      • <small id='m1K8x'></small><noframes id='m1K8x'>

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

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

                <tbody id='m1K8x'></tbody>
                本文介绍了Netbeans:如何包含其他 C++ 静态库项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我对 C++ 真的很陌生,现在正在使用 Netbeans.

                I am really new to c++ and am using Netbeans for now.

                我设法创建了一个包含工作类 Sign 的 Sign.h 和 Sign.cpp.我将这些添加到控制台项目中,效果很好:

                I managed to create a Sign.h and Sign.cpp containing a working class Sign. I added these to a Console Project and it works great:

                  #include <iostream>
                  #include <ostream>
                  #include "Sign.h"
                
                  int main()
                  {
                      Sign sign = Sign::parse("b");
                      std::cout << sign.toString() << " " << sign.getValue() <<"
                ";
                  }
                

                但是,我想创建一个包含 Sign 类的静态库,所以我创建了一个静态库并添加了 Sign.cppSign.h 到它.现在的问题是,我似乎无法将 Sign 类包含在主控制台程序中.

                However, I want to create a static library containing the Sign class, so I created a static library and added Sign.cpp and Sign.h to it. The problem now is, that I can't seem to get my Sign class to be included in the main console program.

                我在 Options => 中添加了库构建 =>链接器 =>库,并将其添加到所需项目.但是我不能使用 #include #include .

                I added the library in Options => Build => Linker => Libraries, and added it to the required projects. However I can't use #include <Sign> or #include <Sign.h>.

                我在这里遗漏了什么?

                推荐答案

                您需要一个库中的两个文件.库文件(Windows 上的 .lib,Linux 上的 .a)和包含文件(.h 文件).

                You need two files from a library. The library file (.lib on windows, .a on linux) and the include file (.h files).

                选项 => 构建 => 链接器 => 库仅用于库文件.您还需要在 File => Project Properties => 下设置包含的路径构建 => C++ 编译器 => 通用 => 包含目录

                The Options => Build => Linker => Libraries is only for the library file. You also need to set the path for the includes under File => Project Properties => Build => C++ Compiler => General => Include Directories

                这篇关于Netbeans:如何包含其他 C++ 静态库项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:Netbeans 9 C++ 支持 下一篇:Netbeans“解决缺少的调试器命令"C++

                相关文章

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

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

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