On Rx72M, I want to generate the lib library file and call it in other projects. The following are my operation steps. Please check which step has a problem, so that it cannot be called finally?

hi

The version of e2 Studio used is November 2021
To generate a static library project in Renesas CC-RX and use it in other projects, follow these steps:
Create a new Renesas C/C++project in the Rx series
-Select File -->New -->Renesas C/C++Project -->Renesas RX
-In the Templates for Renesas RX project window, select the Renesas CC-RX C/C++Library Project and click Next to continue
-On the project details page, enter the name of the static lib project (such as lib). Note that the Chinese name cannot appear, and the selected save path must not appear with a Chinese name. Then click Next to continue
-On the Device and Tool Selection page, select the same device and tool chain as the executable project

After creating a project, in the "src" folder of this project, perform the following operations
Select "New" ->"Source File". In the "Source File" dialog box, enter the file name of the function, such as "test. c", and then click "Finish".
Select "New" ->"Header File". In the "Header File" dialog box, enter the file name of the function, such as "test. h", and then click "Finish".
The example code is as follows:

int add(int a, int b)

{

    return a + b;

}

 

int sub(int a, int b)

{

    return a - b;

}

#ifndef TEST_H_

#define TEST_H_

 

int add(int a, int b);

int sub(int a, int b);

 

#endif /* TEST_H_ */

3. Set the library generation method
Select Build Library (only if options have changed) If the options have changed, or if the user explicitly cleans up the project, a new standard library will be built
Generally, this is the default generation method, and corresponding settings can be made depending on the specific situation

(Generation mode of standard library:
① Build Library (each time) A new standard library is built during each build process. Any dependent files will also be rebuilt
② "Build a library (only if the options have been changed) If the options have changed, or if the user explicitly cleans up the project, a new standard library will be built"
③ Using an existing library file should link to the specified file instead of automatically generated library files
④ "Do not add library files Standard libraries are neither generated nor linked.".
User specified library file (- output):
① If not specified, the default path method will be used
② "If specified, the specified file will be linked instead of the automatically generated library file."
"Select" "Build All" "from the" "Project" "menu to compile the project.".

After the project is successfully compiled, a library file (. lib) will be generated in the project's Debug
6. Call the above generated library file in another project
-Open the project project that needs to call the library file, and create a source code folder under the "src" directory within the project to store the header file of the third-party library, including, and the linked library file
-Copy the header file provided by the third-party library to the folder created in the previous step. Include the header file of a third-party library in the project, so that you can write code to call third-party library functions.
In this folder, write the code to call the library file function
Select "New" ->"Source File".
-In the "Source File" dialog box, enter the file name for calling the library function, such as "main. c", and then click "Finish".
-Write code to call static library functions in the "main. c" file, such as:

#include <stdio.h>

#include "test.h"

 

int main() {

    int a = 10;

    int b = 5;

    int sum = add(a, b);

    int diff = sub(a, b);

    printf("Sum: %d, Diff: %d\n", sum, diff);

    return 0;

}

Next, in the project properties, ensure that the compiler can find the header and library files
① Select the "Tool Settings" tab in the "Settings" page under the "C/C++Build" item
② Select Compiler in the tool settings, click the Source option, select Include file directories (- include) on the right, click Add, and add the corresponding file path

③ Select the "Tool Settings" tab in the "Settings" page under the "C/C++Build" item
④ Find the "C/C++Linker" option, click the "Input" option, and add the path of the added lib library to the linker.

"After adding, click Apply and close, and then select Build and Generate Code.".
After completing all the above steps, compile, download, and debug. "There is no problem with compilation, but when adding variables to the monitor mode, they cannot be read out. An error is reported and there is a problem.".

"I have searched the internet for many questions about the generation and invocation of this lib library, and have tried their methods, but none of them are correct. I don't know which step was wrong, and I'm a bit confused. Now, I beg your advice.".

Thank you.