I have a tiny little project consisting of two C files:
1 - RDSgeneratorDualCoreV01.c (containing main) and
2 - core1. c (containing several functions)
Both located in the same project directory.
Settings:
In the "main" programe,and in
CMakeList.txtCompile Result
The literature states that each include is treated as a new file by the compiler and does not share any definitions with the including file.
OK, so far so good, no problem, let's add stdio.h:
Result (for almost all variables or functions defined in core1.c):
How can this be corrected?
Greetings,
Martin
1 - RDSgeneratorDualCoreV01.c (containing main) and
2 - core1. c (containing several functions)
Both located in the same project directory.
Settings:
In the "main" programe,
Code:
#include "core1.c" // last includeCMakeList.txt
Code:
add_executable(RDSgeneratorDualCoreV01 RDSgeneratorDualCoreV01.c core1.c)It looks like some includes are missing that are already included in the main programme.[build] E:/Documents/1a_VSCode/RDSgeneratorDualCoreV01/core1.c:125:5: error: implicit declaration of function “gpio_put” [-Wimplicit-function-declaration]
[build] 125 | gpio_put(4, 1) ;
[build] | ^~~~~~~~
The literature states that each include is treated as a new file by the compiler and does not share any definitions with the including file.
OK, so far so good, no problem, let's add stdio.h:
Result (for almost all variables or functions defined in core1.c):
It seems to me that core1.c is somehow included twice.Multiple definition of ‘sig1’; CMakeFiles/RDSgeneratorDualCoreV01.dir/RDSgeneratorDualCoreV01.c.obj:E:/Documents/1a_VSCode/RDSgeneratorDualCoreV01/core1.c:50: defined here first ....
How can this be corrected?
Greetings,
Martin
Statistics: Posted by MartinHill — Tue Feb 17, 2026 7:51 pm — Replies 4 — Views 68