driver/gpio.h: No such file or directory

w3llschmidt
Posts: 8
Joined: Tue Jan 23, 2018 4:56 pm

driver/gpio.h: No such file or directory

Postby w3llschmidt » Mon Apr 04, 2022 7:14 pm

Hello Fellows,

all of my ESP-IDF v4.x libs want compile on ESP-IDF v5.0 anymore :o

Same error on all >

Code: Select all

fatal error: driver/gpio.h: No such file or directory
#include "driver/gpio.h"
I cant find out whats the cause is. :?: :?: :?:

Please help!

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: driver/gpio.h: No such file or directory

Postby chegewara » Mon Apr 04, 2022 9:25 pm

I cant find out whats the cause is.
espressif decided to make our life miserable and changed dependency on most common component (driver/gpio).
Here you can find migration guide, but im not sure you find anything about this component:
https://docs.espressif.com/projects/esp ... index.html

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: driver/gpio.h: No such file or directory

Postby Sprite » Tue Apr 05, 2022 2:39 am

In general, your components now need to indicate which other components they depend on. For instance:

Code: Select all

    idf_component_register(SRCS ${SOURCE_FILES}
                           REQUIRES drivers
                           INCLUDE_DIRS "src")

seancross
Posts: 11
Joined: Sun Jun 19, 2022 3:59 pm

Re: driver/gpio.h: No such file or directory

Postby seancross » Thu Jul 14, 2022 1:47 pm

It looks like the proper component is `driver`, not `drivers`:

Code: Select all

idf_component_register(SRC_DIRS "."
    REQUIRES driver
    INCLUDE_DIRS "."
    "include")

PJ_Nyachogo
Posts: 1
Joined: Tue Mar 07, 2023 1:58 pm

Re: driver/gpio.h: No such file or directory

Postby PJ_Nyachogo » Wed Apr 26, 2023 8:08 am

It looks like the proper component is `driver`, not `drivers`:

Code: Select all

idf_component_register(SRC_DIRS "."
    REQUIRES driver
    INCLUDE_DIRS "."
    "include")
Hi. this worked for me. Could you tell, where you got this information? I can't find a list or something in the programming guide

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: driver/gpio.h: No such file or directory

Postby chegewara » Thu Apr 27, 2023 2:22 am


electronicsguy
Posts: 29
Joined: Tue Jan 12, 2016 4:12 pm
Location: Taipei, Taiwan
Contact:

Re: driver/gpio.h: No such file or directory

Postby electronicsguy » Wed Apr 09, 2025 3:15 am

In general, your components now need to indicate which other components they depend on. For instance:

Code: Select all

    idf_component_register(SRCS ${SOURCE_FILES}
                           REQUIRES drivers
                           INCLUDE_DIRS "src")
I have a generic question about includes and Cmake. Sorry if this is too stupid, but:
1. why do we explicitly need to specify the components if we specify an include file?
2. Maybe the include file is named the same for more than 1 component - in this case I understand. But if its uniquely named, is the cmake requires still required?

My code compiles without the extra requires in the cmake, as long as the appropriate headers are included, hence wanted to check.

Who is online

Users browsing this forum: PerplexityBot, Semrush [Bot] and 17 guests