ESP-32 C3编译官方例程缺少头文件

hoo_wave
Posts: 12
Joined: Mon Dec 11, 2023 2:57 am

ESP-32 C3编译官方例程缺少头文件

Postby hoo_wave » Mon Dec 11, 2023 3:22 am

ESP32-C3官方示例modbus-master,编译时提示找不到这两个头文件"modbus_params.h"和"mbcontroller.h"

E:/H3/mb_master/main/master.c:10:10: fatal error: mbcontroller.h: No such file or directory
10 | #include "mbcontroller.h"
| ^~~~~~~~~~~~~~~~
compilation terminated.

c_cpp_properties.json文件内容如下
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "E:\\esp\\.espressif\\tools\\xtensa-esp32-elf\\esp-12.2.0_20230208\\xtensa-esp32-elf\\bin\\xtensa-esp32-elf-gcc.exe",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}

CMakeLists.txt文件内容如下:
set(PROJECT_NAME "modbus_master")

idf_component_register(SRCS "master.c"
INCLUDE_DIRS ".")
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")


ESP-IDF版本5.1.1
请问是哪里配置有问题?如何找到这两个头文件?谢谢

ESP_alisitsyn
Posts: 211
Joined: Fri Feb 01, 2019 4:02 pm
Contact:

Re: ESP-32 C3编译官方例程缺少头文件

Postby ESP_alisitsyn » Fri Dec 15, 2023 11:03 am


Who is online

Users browsing this forum: Google [Bot] and 121 guests