项目开发中,非常多的用户使用Segger Studio,偶尔还会使用它制作library,下面是segger官网制作lib文件的介绍:

https://wiki.segger.com/How_to_create_a_library_project_and_use_it_in_executable_project

可能部分用户无法访问,我将内容“搬运”到下面。


How to create a library project and use it in executable project

SEGGER Embedded Studio can not only be used to create executable projects but also library projects can be created. This article will show how a library project can be created in the same solution as an executable project and being used in the latter.

Example Setup

The setup guide will be based on the following software component:

  • Embedded Studio V4.18 or later

The example project can be found here: SES_Library_Example

Setup Guide

  1. Create a new executable project in a new solution for your target device
  2. Create a new library project in the same solution
  3. Add your library .c and .h files to the library project and build the library
  4. Use the library functions in your executable main application
  5. In Project Settings under Code->Build->Project Dependencies set the executable project to be dependent of the library project. This ensures that the library project will always be build before the executable project and that it will be linker properly.
  6. Build and run the executable application with your new library

Note: If you are simply looking to add a library to your project without project dependencies you can do so either via project option “Additional Input Files” or by adding the library to your project via drag & drop in project explorer.

上文附件:Linking_Library


 

发表评论