` argument for specifying a repository different to the default one.
+
+
+
+```bash
+$ klib -repository
+```
+
+
## Several examples
First let's create a library:
- $ cinterop -h /usr/include/math.h -pkg libc.math -o math
+
+
+```bash
+$ cinterop -h /usr/include/math.h -pkg libc.math -o math
+```
+
+
The library has been created in the current directory:
- $ ls math.klib
- math.klib
+
+
+```bash
+$ ls math.klib
+math.klib
+```
+
+
Now let's check out the contents of the library:
- $ klib contents math
+
+
+```bash
+$ klib contents math
+```
+
+
We can install `math` to the default repository:
- $ klib install math
+
+
+```bash
+$ klib install math
+```
+
+
Remove any traces of it and its build process from the current directory:
- $ rm -rf ./math*
+
+
+```bash
+$ rm -rf ./math*
+```
+
+
Create a very short program and place it into a `sin.kt` :
- import libc.math.*
- fun main(args: Array) {
- println(sin(2.0))
- }
+
+
+```kotlin
+import libc.math.*
+fun main(args: Array) {
+ println(sin(2.0))
+}
+```
+
+
Now compile the program linking with the library we have just created:
- $ kotlinc sin.kt -l math -o mysin
+
+
+```bash
+$ kotlinc sin.kt -l math -o mysin
+```
+
+
And run the program:
- $ ./mysin.kexe
- 0.9092974268256817
+
+
+```bash
+$ ./mysin.kexe
+0.9092974268256817
+```
+
+
Have fun!
@@ -117,7 +214,7 @@ directory structure, with the following layout:
**foo.klib** when unpacked as **foo/** gives us:
-```
+```yml
- foo/
- targets/
- $platform/
diff --git a/PLATFORM_LIBS.md b/PLATFORM_LIBS.md
index 5139c6fc60c..c31f140796a 100644
--- a/PLATFORM_LIBS.md
+++ b/PLATFORM_LIBS.md
@@ -28,7 +28,6 @@ Note that the content of `platform.posix` is NOT identical on
different platforms, in the same way as different `POSIX` implementations
are a little different.
-
### Popular native libraries