Operation process generated by eclipse firmware library

1. Method introduction

Sometimes we need to package a certain functional module into a library, leaving only the interface for others to use, then we need to package it, how does eclipse operate? This article only discusses the two methods I know. If there is a simpler method, netizens are very welcome to add it.

1. Generate in an existing project, compile the source code that needs to be packaged into a library separately in the project, and shield other source files that do not need to be packaged;

2. Directly create a new project to generate the library, put the required source code into the project, and compile it in the way of generating the library. This is more direct and simple.

In fact, the principles of generating libraries in both ways are the same. The two operating procedures for generating firmware libraries are introduced below.

2. Generate library files from part of the source code in an existing project

Source files that do not need to participate in compilation can be temporarily blocked as shown below

Leave the source files that need to be compiled into libraries and set the output files to library files.

Click compile and get the final library file

3. Create a new project to generate library files and add source code to generate library files.

如图 new --> C++ project --> Static Library -->next --> finish

After completing programming, click build and you will see that the generated .a file under Debug is the static library you want.

Guess you like

Origin blog.csdn.net/Damon_Sandy/article/details/130921433