arkhipenko / TaskScheduler

Cooperative multitasking for Arduino, ESPx, STM32, nRF and other microcontrollers
http://playground.arduino.cc/Code/TaskScheduler
BSD 3-Clause "New" or "Revised" License
1.32k stars 243 forks source link

ODR Violation With Multiple Uses of TaskScheduler Throughout a Project #175

Closed tkw722 closed 1 year ago

tkw722 commented 1 year ago

Hello!

I've got a pretty simple problem that is leading to a pretty massive blocker. I'm including TaskScheduler.h in several places throughout my project as I have tasks in several different places throughout the project. The challenge I'm running into, is TaskScheduler seems to have been built with both declarations and definitions in the same .h file. This results in breaking the One Definition Rule when the compiler runs causing multiple definition warnings and a build failure. Have others seen this issue? Is there a way past this? I fully acknowledge that there could be something simple I'm just missing.

Thanks!

arkhipenko commented 1 year ago

Check examples 16 and/or 27.