Hi
I am running esp-idf 4.1 with vsCode.
The compiler cant find mqtt_client.h
Using a file browse I can see that the file is there,,,, so it must be something wrong with my configuration.
What should I look for ????
error: mqtt_client.h: No such file or directory
-
- Posts: 48
- Joined: Fri Sep 17, 2021 4:02 pm
-
- Posts: 48
- Joined: Fri Sep 17, 2021 4:02 pm
Re: error: mqtt_client.h: No such file or directory
I've learned a bit more, but still not solved my problem.
When I started the project it was as a arduino-esp32 project. I had a lot of legacy code from before that I used. I have replaced most of my arduino code and was in the process to replace the asyncMqttClient when I run into this problem.
My guess is that my problem have to do with sdkConfig file and how it is configured. Unfortunately using "menuconfig" I cant find any parameter that can be changed to help me.
Is there a description for deeper understanding of sdkconfig ???
When I started the project it was as a arduino-esp32 project. I had a lot of legacy code from before that I used. I have replaced most of my arduino code and was in the process to replace the asyncMqttClient when I run into this problem.
My guess is that my problem have to do with sdkConfig file and how it is configured. Unfortunately using "menuconfig" I cant find any parameter that can be changed to help me.
Is there a description for deeper understanding of sdkconfig ???
-
- Posts: 48
- Joined: Fri Sep 17, 2021 4:02 pm
Re: error: mqtt_client.h: No such file or directory
I did this.
I created a new ESP project using MQTT template.
Compiled it,, worked fine.
Then I copied all my component from the old project.
Compiled it,,, same error showed up => "fatal error: mqtt_client.h: No such file or directory"
I created a new ESP project using MQTT template.
Compiled it,, worked fine.
Then I copied all my component from the old project.
Compiled it,,, same error showed up => "fatal error: mqtt_client.h: No such file or directory"
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: error: mqtt_client.h: No such file or directory
Are you using mqtt in one of your components (that is, not the 'main' component)? In that case, you need to add it to the REQUIRES section. See the docs for more info.
Re: error: mqtt_client.h: No such file or directory
这种情况可能有用的解决方法是往你自己工程文件夹中main文件夹下面的CMakeLists.txt文件中idf_component_register这行下面的REQUIRES后面添加缺少的头文件所对应的子模块而子模块的名称为esp-idf-vx.x目录下components目录内模块的名称。例如你这里就是添加“mqtt” 。
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS .
REQUIRES mqtt)
也许有用,可以试试。
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS .
REQUIRES mqtt)
也许有用,可以试试。
-
- Posts: 48
- Joined: Fri Sep 17, 2021 4:02 pm
Re: error: mqtt_client.h: No such file or directory
Thanks.
How to know when to use :
REQUIRES xxxx
Normally ESP-IDF stuff is added automagically
Thanks again.
How to know when to use :
REQUIRES xxxx
Normally ESP-IDF stuff is added automagically
Thanks again.
Re: error: mqtt_client.h: No such file or directory
当你需要某种功能,比如examples目录下的那些项目的功能时就需要添加对应的子模块到REQUARS里。或者你加了某些功能但出现了你现在这样的错误就可能需要添加对应的子模块
Who is online
Users browsing this forum: Majestic-12 [Bot], Sang_Huynh and 225 guests