gb single-file public domain libraries for C & C++; gingerBill (2015).
npm install libgb.cbash
$ npm i libgb.c
`
And then include gb.h, and related, as follows:
`c
// main.c
#define GB_IMPLEMENTATION
#include "node_modules/libgb.c/gb.h"
#define GB_MATH_IMPLEMENTATION
#include "node_modules/libgb.c/gb_math.h"
#define GB_STRING_IMPLEMENTATION
#include "node_modules/libgb.c/gb_string.h"
#define GB_INI_IMPLEMENTATION
#include "node_modules/libgb.c/gb_ini.h"
#define GBGL_IMPLEMENTATION
#include "node_modules/libgb.c/gb_gl.h"
int main() { / ... / }
`
Finally, compile while adding the path node_modules/libgb.c to your compiler's include paths.
`bash
$ clang -I./node_modules/libgb.c -I./node_modules/stb.c main.c # or, use gcc
$ gcc -I./node_modules/libgb.c -I./node_modules/stb.c main.c
`
You may also use a simpler approach with the cpoach tool, which automatically adds the necessary include paths of all the installed dependencies for your project.
`bash
$ cpoach clang main.c # or, use gcc
$ cpoach gcc main.c
`
FAQ
$3
These libraries are in the public domain. You can do anything you want with them. You have no legal obligation to do anything else, although I would appreciate attribution.
$3
No.
$3
Yes. I think these libraries are brilliant and use many of these on a daily basis.
$3
Yes.
$3
I may change it in the future but at the moment it is like this this:
1.23b
* 1 = major version
* 23 = minor version
* b` = patch