How to add header and source files to project

christian28
Posts: 2
Joined: Wed Feb 19, 2020 2:41 pm

How to add header and source files to project

Postby christian28 » Fri Feb 21, 2020 2:51 pm

Hi all
I'm using eclipse and an esp32 wroom module.

I already setup the environment.
For simple projects like blink example and hello world example it's no problem to build, flash and debug. This works very fine.

Only problem is how to add header and sourcefiles?
As example: I want to write a mathfunction in another file and call the function from main. Eclipse always says that theres no reference. Please see attached files.

Best regards
Christian
Attachments
test_header.h
(190 Bytes) Downloaded 28 times
test_header.c
(157 Bytes) Downloaded 25 times
main.c
(98 Bytes) Downloaded 29 times

User avatar
ESP_krzychb
Posts: 272
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: How to add header and source files to project

Postby ESP_krzychb » Fri Feb 21, 2020 9:46 pm

Hi christian28,

Do you have "CMakeLists.txt" files in your project?
Is "test_header.c" included in "CMakeLists.txt" in your "main" folder?

I think the safest way to start a new project is by going to File > New > Espressif IDF Project. This will set the key files for you. Then add your extra files and update CMakeLists.txt.

Please check https://github.com/espressif/esp-idf/tr ... r/examples how this is done for small typical projects or see formal description in https://docs.espressif.com/projects/esp ... le-project.

Who is online

Users browsing this forum: No registered users and 3 guests