NetBeans创建一个静态库c ++

时间:2022-09-01 16:53:31

I have already a project in C++ and I want to create a static library for this project. I placed in the NetBeans my C++ project via Drag and drop.

我已经有一个C ++项目,我想为这个项目创建一个静态库。我通过拖放将NetBeans放入了我的C ++项目中。

Now, how can I create a static library for this project?

现在,我该如何为这个项目创建一个静态库?

I have 8.2 version NetBeans in Linux

我在Linux中有8.2版NetBeans

1 个解决方案

#1


0  

If you don't have any project or build system configured yet, you can either create a netbeans project or a project based on a build tool like cmake or make. If you already have a running build system it's possible to use this from within NB.

如果尚未配置任何项目或构建系统,则可以基于cmake或make等构建工具创建netbeans项目或项目。如果您已经有一个正在运行的构建系统,则可以在NB中使用它。

New Netbeans Project

First create a Netbeans Project for a static library:

首先为静态库创建一个Netbeans项目:

  1. New Project --> C/C++
  2. 新项目 - > C / C ++

  3. C/C++ Static Library
  4. C / C ++静态库

  5. Copy your source to the project or set the paths to your source
  6. 将源复制到项目或设置源的路径

Using a build system (eg. Cmake or Make)

This set applies to the case where you already have an existing build system or want to use one.

此集适用于已有现有构建系统或想要使用现有构建系统的情况。

  1. New Project --> C/C++
  2. 新项目 - > C / C ++

  3. C/C++ Project with Existing Sources
  4. 具有现有源的C / C ++项目

  5. Select the path of your source code and select what you need. Follow the wizard and you are done.
  6. 选择源代码的路径并选择所需内容。按照向导完成。


For using CMake you can get a detailed step to step guide here.

要使用CMake,您可以在此处获得详细的步骤指南。

#1


0  

If you don't have any project or build system configured yet, you can either create a netbeans project or a project based on a build tool like cmake or make. If you already have a running build system it's possible to use this from within NB.

如果尚未配置任何项目或构建系统,则可以基于cmake或make等构建工具创建netbeans项目或项目。如果您已经有一个正在运行的构建系统,则可以在NB中使用它。

New Netbeans Project

First create a Netbeans Project for a static library:

首先为静态库创建一个Netbeans项目:

  1. New Project --> C/C++
  2. 新项目 - > C / C ++

  3. C/C++ Static Library
  4. C / C ++静态库

  5. Copy your source to the project or set the paths to your source
  6. 将源复制到项目或设置源的路径

Using a build system (eg. Cmake or Make)

This set applies to the case where you already have an existing build system or want to use one.

此集适用于已有现有构建系统或想要使用现有构建系统的情况。

  1. New Project --> C/C++
  2. 新项目 - > C / C ++

  3. C/C++ Project with Existing Sources
  4. 具有现有源的C / C ++项目

  5. Select the path of your source code and select what you need. Follow the wizard and you are done.
  6. 选择源代码的路径并选择所需内容。按照向导完成。


For using CMake you can get a detailed step to step guide here.

要使用CMake,您可以在此处获得详细的步骤指南。