Page 1 of 1

Issue finding standard library includes using external component

Posted: Tue Apr 18, 2023 9:10 am
by joenoonanSD
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!

Re: Issue finding standard library includes using external component

Posted: Wed Apr 19, 2023 7:08 am
by ESP_kondalkolipaka
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