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.23k stars 224 forks source link

Cannot use <TaskScheduler.h> in several .h-files in one Project - Preprocessor-Statement issue? #54

Closed Miautomat closed 6 years ago

Miautomat commented 6 years ago

I'm running into problems using this library in several headerfiles in my Project and I wonder if this is a problem with the preprocessor-statement because I'm not having this issue with other libraries like or else.

I could make it work using in my Project.ino and in my other Header-Files that need to work with Tasks and so on.

This is the minimal source-code that reproduces the error: https://gitlab.com/narjesmieke/project My problem, the error as well as my current workaround is described in the following Stackoverflow-Post: https://stackoverflow.com/questions/50291528/preprocessing-for-taskscheduler-library-doesnt-work-multiple-definition-error

arkhipenko commented 6 years ago

You need to do it as described in this example: https://github.com/arkhipenko/TaskScheduler/tree/master/examples/Scheduler_example16_Multitab

Duplicate of #51

arkhipenko commented 6 years ago

Hi,

You need to do it as described in this example: https://github.com/arkhipenko/TaskScheduler/tree/master/examples/Scheduler_example16_Multitab

Please let me know if that solves your issue.

Regards, Anatoli


From: PeiPei15 notifications@github.com Sent: Monday, May 14, 2018 3:52 AM To: arkhipenko/TaskScheduler Cc: Subscribed Subject: [arkhipenko/TaskScheduler] Cannot use in several .h-files in one Project - Preprocessor-Statement issue? (#54)

I'm running into problems using this library in several headerfiles in my Project and I wonder if this is a problem with the preprocessor-statement because I'm not having this issue with other libraries like or else.

I could make it work using in my Project.ino and in my other Header-Files that need to work with Tasks and so on.

This is the minimal source-code that reproduces the error: https://gitlab.com/narjesmieke/project My problem, the error as well as my current workaround is described in the following Stackoverflow-Post: https://stackoverflow.com/questions/50291528/preprocessing-for-taskscheduler-library-doesnt-work-multiple-definition-error

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/arkhipenko/TaskScheduler/issues/54, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AATGTVgXHGNioUUrsjNvGN9DqXDp26drks5tyTe2gaJpZM4T9UDo.