Closed paleozogt closed 5 years ago
The listing on single-file-libs explicitly says it's two files, not one, so there's no meaningful bug here.
The problem isn't that there's two files, or even that you have to include a .cpp file (which is weird enough). The problem is that you can't include the .cpp file more than once.
Consider these two modules of in the same project:
// foo.cpp
#include "yaml/Yaml.hpp"
#include "yaml/Yaml.cpp"
...
and
// bar.cpp
#include "yaml/Yaml.hpp"
#include "yaml/Yaml.cpp"
...
This will lead to multiply-defined symbols. This doesn't seem like a header-only library to me.
Nobody in their right mind should be including a .cpp file into another .cpp file. Just add the mini-yaml.cpp to your srcs in your makefile.
On Thu, May 23, 2019, 5:49 PM Aaron Simmons notifications@github.com wrote:
The problem isn't that there's two files, or even that you have to include a .cpp file (which is weird enough). The problem is that you can't include the .cpp file more than once.
Consider these two modules of in the same project:
// foo.cpp
include "yaml/Yaml.hpp"
include "yaml/Yaml.cpp"
...
and
// bar.cpp
include "yaml/Yaml.hpp"
include "yaml/Yaml.cpp"
...
This will lead to multiply-defined symbols. This doesn't seem like a header-only library to me.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nothings/single_file_libs/issues/156?email_source=notifications&email_token=ACP4IKG26NGUZH3SBPF5KRLPW4GONA5CNFSM4HPKM2Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWDSU5Q#issuecomment-495397494, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP4IKFRMYJLHTCQYLE2ONDPW4GONANCNFSM4HPKM2ZQ .
Exactly. But isn't adding a .cpp file into your project the exact kind of integration complexity that single-file header libraries are trying to avoid?
Any entry in single-file-libs with > 1 in the 'files' column is generally not a header-file-only library. If you only want header-file-libraries only, avoid any entry with > 1 in the files column. This is discussed in the FAQ at the bottom of the list, and just above the FAQ.
I would say it has more to do with avoiding the complexity of dynamic linking and keeping all your code in one place. It's not really complex to add one file to your sources list. It's much more difficult to track down a specific version of a dll or a rare library for compiling ancient software.
On Thu, May 23, 2019, 6:18 PM Aaron Simmons notifications@github.com wrote:
Exactly. But isn't adding a .cpp file into your project the exact kind of integration complexity that single-file header libraries are trying to avoid?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nothings/single_file_libs/issues/156?email_source=notifications&email_token=ACP4IKE2U6Y76IQHWBLAAZLPW4J25A5CNFSM4HPKM2Z2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWDUQXY#issuecomment-495405151, or mute the thread https://github.com/notifications/unsubscribe-auth/ACP4IKB2QRWHG227NYL67ULPW4J25ANCNFSM4HPKM2ZQ .
I guess I misunderstood this list to be #include-only libraries, even if there were more than one file to #include.
Sorry for the trouble.
..., even if there were more than one file to #include.
No, you'll need to include one file, yaml.hpp, but you'll also need to compile yaml.cpp.
While mini-yaml has a single interface header, it requires compiling/linking to an implementation .cpp file.
See mini-yaml issue here.