3 ms·
gcc or clang would crash on the linking step complaining about duplicate symbols. This library is only good for a project that is built in a single .c file.
by jandrese 4y ago
gcc or clang would crash on the linking step complaining about duplicate symbols. This library is only good for a project that is built in a single .c file.
- anthk 4y agoFalse.
- esrauch 4y agoThat's not true in this case: if you look at the .c file you can see it actually has no definitions by default and is a relatively normal .h file when it's included. You can #include it in any number of files as long as exactly one has #define OLIVEC_IMPLEMENTATION.
- dundarious 4y agoThere are many single-file C "libraries" that work perfectly fine as both "header" and "implementation", and that do not require unity builds (building everything as a single translation unit, e.g., a single .c file). Here is but one famous collection of them: https://github.com/nothings/stb https://github.com/nothings/stb