Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Moved the implementation header file to a separate .cpp file #6

Closed
wants to merge 1 commit into from
Closed

Conversation

jjwbruijn
Copy link

My project using timers across multiple files wouldn't compile, because the header would pull the same implementation from the different files. I moved the implementation header to a cpp file and removed the bottom #include in ESP32_ISR_Timer.h

My project using timers across multiple files wouldn't compile, because the header would pull the same implementation among the different files. I moved the implementation header to a cpp file and removed the bottom #include in  ESP32_ISR_Timer.h
@khoih-prog
Copy link
Owner

Thanks for your PR.

I'm about to convert all the libraries using h-only style into both h-only and standard-cpp to provide an option to people having Multiple Definitions Linker Error

Please have a look at what has been done to other libs such as:

HOWTO Fix Multiple Definitions Linker Error in ESP_WiFiManager
HOWTO Fix Multiple Definitions Linker Error in ESPAsync_WiFiManager
and many more

So I'm sorry I won't merge your PR but will create a new version to give the better options to use either way.

@khoih-prog khoih-prog closed this Oct 26, 2020
@jjwbruijn
Copy link
Author

Thanks for your quick reply and this awesome library! Too bad this means you will always need to perform manual actions after pulling the library using PlatformIO, reducing the user-friendlyness somewhat. But choice is always good :)

@khoih-prog
Copy link
Owner

khoih-prog commented Oct 26, 2020

you will always need to perform manual actions after pulling the library using PlatformIO, reducing the user-friendlyness somewhat. But choice is always good :)

That's the difficult choice I had to make some time ago, and I decided to go with h-only style because of many benefits, one of them is the permeation of definitions (debug, options, etc.) from the sketch into all the libraries at compile time.

And I still like the current approach after writing many libs using the h-only style, but I still give the options for the standard-cpp style from the feedbacks of libs' users like you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants