Fixed linker errors when included in multiple .cpp files#1
Fixed linker errors when included in multiple .cpp files#10xFEEDC0DE64 wants to merge 1 commit intokhoih-prog:masterfrom
Conversation
|
Thanks so much for using the library and the PR. The conversion of all xyz.cpp to xyz-Impl.h is intentional to
You can try to see the feature and why. Depending on your code, you can have linker complaint sometimes. The solution can be either
See the similar problem and solution in Issue 3 of WebSockets2_Generic: multiple definition of `websockets2_generic::WebsocketsServer::~WebsocketsServer()' in websocket2_generic library
I won't modify the library back as your PR, but will put a note in README so that anybody having the similar issue can know how to deal. Certainly I will add a note for your contribution. Regards, |
### Releases v1.0.1 1. Restore cpp code besides Impl.h code to use in case of `multiple definition` linker error. Thanks to [Daniel Brunner](https://github.com/0xFEEDC0DE64) to report and make PR in [**Fixed linker errors when included in multiple .cpp files**](#1). See [**HOWTO Fix `Multiple Definitions` Linker Error**](https://github.com/khoih-prog/AsyncHTTPRequest_Generic#HOWTO-Fix-Multiple-Definitions-Linker-Error)
|
Just release v1.0.1 to address the issue and add |
Hi,
I was using your library in my project, and when I started including your .h files in multiple .cpp files (compile units), the linker started complaining, as all your symbols where exported from multiple .o files.
I moved your implementations into .cpp files, which allows for linkage instead of inlining, which should not affect performance much.