I have a file tree like this:
Code: Select all
- myProject/
- CMakeLists.txt
- sdkconfig
- components/ - component1/ - CMakeLists.txt
- Kconfig
- src1.c
- component2/ - CMakeLists.txt
- Kconfig
- src1.c
- include/ - component2.h
- main/ - CMakeLists.txt
- src1.c
- src2.c
- build/
On my research I found that some of those elements have to be extern and tried adding extern but keep having the same problem of multiple definitions or errors with parameter inside the function/variable.
I also find that you can compile various *.c files by changing (or adding) something on the CMakeLists files, Can someone give a simple example of how to do that?
PS: I tried
Code: Select all
idf_component_register(SRCS "src1.c" "src2.c"
INCLUDE_DIRS "."
COMPONENT_EMBED_FILES "aWebPage.html")
Regards,
P