[x] PlatformIO Core.
If you’ve found a bug, please provide an information below.
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Windows 10
PlatformIO Version (platformio --version): 6.1.4
Description of problem
I'm trying to move a project from C to C++.
I have main.c and main.cpp in Src folder, both of them contains int main().
I understand this will result in an error when linking since we have to instance of different int main().
As following platformio.ini configured, I told the build system to ignore Src/main.c and Src/gpio.c.
Which did not work, the build system still trys to build Src/main.c.
I tested with Src/gpio.c only, this works, it seems something else checking what to build for main() do not respect build_src_filter.
If I simplely rename main.c to main_old.c and ignore it with -<Src/main_old.c> then it works fine.
*** Multiple ways to build the same target were specified for: C:\_projects\_playgrounds\stm32cube\pioBased\.pio\build\nucleo_f767zi\src\main.o (from ['C:\\_projects\\_playgrounds\\stm32cube\\pioBased\\Src\\main.c'] and from ['C:\\_projects\\_playgrounds\\stm32cube\\pioBased\\Src\\main.cpp'])
File "C:\Users\localadmin\.platformio\penv\lib\site-packages\platformio\builder\tools\piobuild.py", line 355, in <listcomp>
What kind of issue is this?
You can erase any parts of this template not applicable to your Issue.
Configuration
Operating system: Windows 10
PlatformIO Version (
platformio --version
): 6.1.4Description of problem
I'm trying to move a project from C to C++. I have
main.c
andmain.cpp
inSrc
folder, both of them containsint main()
. I understand this will result in an error when linking since we have to instance of differentint main()
. As followingplatformio.ini
configured, I told the build system to ignoreSrc/main.c
andSrc/gpio.c
. Which did not work, the build system still trys to buildSrc/main.c
. I tested withSrc/gpio.c
only, this works, it seems something else checking what to build for main() do not respectbuild_src_filter
.If I simplely rename
main.c
tomain_old.c
and ignore it with-<Src/main_old.c>
then it works fine.The content of
platformio.ini
:Error Message