- 把外部
.c
文件放到.cpp
工程下的 main 文件夹 - 然后在
.cpp
工程下声明.c
文件下的 hello_main 函数 - 同时在 cpp 工程的
CmakeLists.txt
文件下加上.c
文件 - 最后在
.cpp
工程下调用 hello_main 函数即可
基于 esp-idf SDK ,如何在 .cpp 工程中加入.c 的文件调用?
最新推荐文章于 2024-03-12 14:46:28 发布
.c
文件放到 .cpp
工程下的 main 文件夹.cpp
工程下声明 .c
文件下的 hello_main 函数CmakeLists.txt
文件下加上 .c
文件.cpp
工程下调用 hello_main 函数即可extern "C"
定义一下 .c 文件 main 函数CmakeLists.txt
文件下加上 .c 文件