I've ran into a confusion about how to properly use header-only library. Googling didn't help as I didn't find anything about using header-only libraries.
So my question is: Should I just copy the header files and paste them into my project folder and use them that way or should I link them to the project using C\C++ >> General >> Additional Include Directories?
I'd say copying the file to your project folder is preferable. That way your project is self contained. You could then give it to someone else and he would be able to build it without having to change any configuration.
Now, if you use boost which also has header-only libraries it is another story. Boost is easily obtainable and having your project depend on boost is less problematic. In that case I would add it in the Additional Includes.
You can do either, it is really a question of convenience. Traditionally you would include them in your include path, but you can also put them in your project. Including them in your project makes it more self-contained and protects you from code-breaking library changes, but also means you have to install library security-related updates to each project's copy, for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With