Selaa lähdekoodia

Explain how to manually install a dynamic library

Box2d for cpp for example.
DricomDragon 4 vuotta sitten
vanhempi
commit
03befe6265
1 muutettua tiedostoa jossa 34 lisäystä ja 0 poistoa
  1. 34 0
      Guides/os.md

+ 34 - 0
Guides/os.md

@@ -38,3 +38,37 @@ FTL and Into the Breach saves are in `.local/share/` folder.
 
 `sudo update-grub`
 
+## Install dynamic library
+
+Tested with [box2d](https://github.com/erincatto/box2d).
+
+### Install includes
+
+Header files (`*.h`) must rely in a include folder, like `/usr/local/include/`. You can group headers in folders, but you have to take folders into account for preprocessing :
+
+On your file system :
+
+```
+include
+|—— hello.h
+\—— box2d
+	|── b2_world.h
+	\—— box2d.h
+```
+
+In C++ :
+
+```
+#include <hello.h>
+#include <box2d/box2d.h>
+```
+
+### Library
+
+Compiled files (`*.a` or `*.so`, commonly generated through a buil system like `make` or `cmake`), must rely in a linked folder, like `/usr/local/lib`.
+
+### Linking
+
+If your static lib is named `libhello.a`, you link with the compiler flag `-lhello`.
+
+For instance, `libbox2d.a` is linked with the flag `-lbox2d`.