Issue finding standard library includes using external component

joenoonanSD
Posts: 1
Joined: Tue Apr 18, 2023 9:03 am

Issue finding standard library includes using external component

Postby joenoonanSD » Tue Apr 18, 2023 9:10 am

Hi,

I have created an external component in ESP which is for my common code, and therefore I do not want to put it in the components folder of my main project. Doing this I have a problem in the external component whereby it cannot find any standard library at all.
My main project has no problem.

Is there a way of forcing my external component to find the standard library includes?

In my main project CMakeLists.txt I have included - list(APPEND EXTRA_COMPONENT_DIRS "../custom_external_component"), which builds find but the IDE still cannot find the includes in the component. Do I need to add anything specific to my CMakeLists.txt file in my external component?

Project layout:
- MainProject
- CMakeLists.txt
- Main
- Some source files
- CMakeLists.txt
- ExternalComponent
- Code
- CMakeLists.txt

Any help is appreciated!

ESP_kondalkolipaka
Posts: 188
Joined: Wed Jul 17, 2019 5:26 pm

Re: Issue finding standard library includes using external component

Postby ESP_kondalkolipaka » Wed Apr 19, 2023 7:08 am

Hello,

Could you check if you are able to find that extra component in the compile_commands.json file? This is generated by the CMake during the build which is used by the CDT Indexer to resolve the headers.

Please find a similar discussion on this here https://github.com/espressif/idf-eclips ... /issues/79

Do you mind sharing a sample project to try out?

Thanks

Who is online

Users browsing this forum: No registered users and 38 guests