rx72m使用lib库 lib库的封装与使用

写的程序想生成个库,把相关的.c文件和.h文件封装编译,生成xxx.lib,然后把xxx.lib和xxx.h给别人使用即可

我不知道瑞萨的rx72系列把源码封装成库,或者使用别人的库进行调用,其中的细节和流程不是很清楚,有不会的地方,比如我按照以下步骤生成静态库项目

以下步骤显示了如何创建静态库项目的示例

1、选择文件 --> 新建 --> Renesas C/C++ Project --> Renesas RX

2、 选择Renesas CC-RX C/C++ Library Project,单击下一步继续

3、在项目详细信息页面上,输入静态lib项目的名称,(例如lib),然后单击next

4、在设备和工具选择中,选择与可执行项目相同的设备和工具链

创建出工程后不知道怎么生成库,然后给别人调用。

个人邮箱:[email protected]

Parents
  • To generate a static library project in Renesas CC-RX and use it in other projects, you can follow these steps:

    Create a new Renesas C/C++ project in the RX series.
    Choose the "Renesas CC-RX C/C++ Library Project" option and give your project a name.
    Select the same device and tool chain as the executable project in the device and tool selection page.
    Write your source code and add it to the project. Be sure to include any necessary header files.
    Compile the project by selecting "Build All" from the "Project" menu.
    After the project has been successfully compiled, a static library (.lib) file will be generated in the project's output folder.
    To use this library in another project, you need to include the library file and the necessary header files in the project settings.
    Finally, you can use the functions and variables defined in your static library in the other project by including the appropriate header files and calling the functions as needed.
    It's important to note that the process may vary slightly depending on the specific version of Renesas CC-RX you are using and the requirements of your project. Be sure to consult the documentation and seek additional assistance as needed. SkyWard Alpine

  • Ok, thanks, I have one more question, if you use the firmware library provided by the official, the intelligent configurator generates the code accordingly, and makes the configuration. Now, what if you want to make a static library of this project file?

    For example, I used the firmware library of e2studio in my CAN project, which CAN generate the corresponding code through the intelligent configurator. I added the CAN module using it. Now, I have realized the CAN communication function of it, and I want to generate the lib library with it.

    I also built a static library project and copied all the source code from CAN project, but they all lacked the corresponding firmware library file declaration, indicating that the compilation would not pass. There were a bunch of problems, because in CAN project, some contents such as configuration interrupt and peripheral clock module PLCKB were generated directly on the intelligent configurator. The static library project does not have this.scfg file, or smart configurator

Reply
  • Ok, thanks, I have one more question, if you use the firmware library provided by the official, the intelligent configurator generates the code accordingly, and makes the configuration. Now, what if you want to make a static library of this project file?

    For example, I used the firmware library of e2studio in my CAN project, which CAN generate the corresponding code through the intelligent configurator. I added the CAN module using it. Now, I have realized the CAN communication function of it, and I want to generate the lib library with it.

    I also built a static library project and copied all the source code from CAN project, but they all lacked the corresponding firmware library file declaration, indicating that the compilation would not pass. There were a bunch of problems, because in CAN project, some contents such as configuration interrupt and peripheral clock module PLCKB were generated directly on the intelligent configurator. The static library project does not have this.scfg file, or smart configurator

Children
No Data