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

suggest replacing all files xxxx_Impl.h by xxxx.cpp #22

Closed
pabloandresm opened this issue Mar 12, 2022 · 10 comments
Closed

suggest replacing all files xxxx_Impl.h by xxxx.cpp #22

pabloandresm opened this issue Mar 12, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@pabloandresm
Copy link
Contributor

May I suggest suggest replacing all files xxxx_Impl.h by xxxx.cpp?

Having all code in .h header files creates linking errors if you "#include <MySQL_Generic>" from different .cpp modules of the same project, because the linker will find several times functions with the same name.

Having a proper .h corresponding to a proper .cpp, you can include the .h several times from everywhere without causing lining problems.

It happened to me.

Just a suggestion.

@khoih-prog
Copy link
Owner

Have a look at

  1. HOWTO Fix Multiple Definitions Linker Error or similar issues.
  2. Different behaviour using the src_cpp or src_h lib #80

I forget to convert this to h-only library with example similar to multiFileProject how to deal with the issue.

Will publish new release to deal with this, but never going back to .cpp-style, unless absolutely necessary.

@khoih-prog khoih-prog added the enhancement New feature or request label Mar 12, 2022
@pabloandresm
Copy link
Contributor Author

thank you for that info.
I ll read those links.
thanks

@khoih-prog
Copy link
Owner

Hi @pabloandresm

The new MySQL_MariaDB_Generic releases v1.7.0 has just been published. Your contribution is noted in Contributions and Thanks

Please test one of the new examples, such as multiFileProject_Ethernet, to see how to do for multiple-file projects to avoid Multiple Definitions Linker Error

Best Regards,

PS:

I'm excited and so busy to follow up with your suggestions, but still wish you provide many more ;-))


Releases v1.7.0

  1. Convert to h-only style
  2. Add multiFileProject examples to demo for multiple-file projects

@pabloandresm
Copy link
Contributor Author

thank you very much.

I will try to keep up with the suggestions and fixes.

Are you going to publish it soon? so I can install it via Arduino.

Let me try the 1.7.0 and stress it and I will let you know.

thank you very much

@khoih-prog
Copy link
Owner

khoih-prog commented Mar 13, 2022

Already published v1.7.0. You can install from Arduino or PlatformIO now.

@pabloandresm
Copy link
Contributor Author

strange.....arduino shows me the latest one as 1.6.1, and not the 1.7.0

@khoih-prog
Copy link
Owner

It takes some time to propagate to Library Manager (some hours ??). You can download directly from the GitHub, then unzip.

PS:

You have a good talent to finding bugs, especially using your stress tests. I wish you can use that to spots the bugs in my other libraries.

@pabloandresm
Copy link
Contributor Author

yes, sure. Which other libraries you need to test?

one detail I forgot to mention.....since 1.6.0, when I update this library on Arduino IDE, it asks me if I want to update just this library or the dependencies also (it shows me a list of 5 dependency libraries). If I choose all dependencies, it successfully updates ONLY this library and fails with an error. Maybe this is caused by some dependency you marked that are ment to be for platformio?

I will screenshot it next time.

@khoih-prog
Copy link
Owner

khoih-prog commented Mar 13, 2022

If I choose all dependencies, it successfully updates ONLY this library and fails with an error.

Because this library is written to support too many boards, shields, libraries, architectures and platforms, I have to add all of them to the list. Many users complaint long ago if not. So better extra than nothing.

Sometimes, the Arduino IDE and/or PIO is not intelligent enough to select the correct libraries for that architectures / platform.

So, you have to manually install the necessary libraries, at least you know the list.

@khoih-prog
Copy link
Owner

khoih-prog commented Mar 13, 2022

yes, sure. Which other libraries you need to test?

You can see my full list of 130+ libraries in KH Libraries

Just jump into any library you're interested and possibly will use in your project, then click Homepage to jump to GitHub to download / test. All are in Arduino IDE Library Manager as well and you can use the name to install.

Selection_116

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

No branches or pull requests

2 participants