Added linking section

This commit is contained in:
Justin Ethier 2020-02-24 18:19:48 -05:00
parent e6ebacae74
commit d4cbdb7362

View file

@ -19,6 +19,7 @@ title: User Manual
- [Foreign Function Interface](#foreign-function-interface)
- [Writing a Scheme Function in C](#writing-a-scheme-function-in-c)
- [Including a C Header File](#including-a-c-header-file)
- [Linking to a C Library](#linking-to-a-c-library)
- [Licensing](#licensing)
- [References and Further Reading](#references-and-further-reading)
@ -229,6 +230,15 @@ Or as part of a program (add any includes immediately after the `import` express
By default this will generate an `#include` preprocessor directive with the name of the header file in double quotes. However, if `include-c-header` is passed a text string with angle brackets (EG: `"<stdio.h>"`), the generated C code will use angle brackets instead.
## Linking to a C Library
A Cyclone library may use the `c-linker-options` expression to instruct the compiler to include linker options when building an executable. For example:
(define-library (cyclone curl)
(include-c-header "<curl/curl.h>")
(export curl-version)
(c-linker-options "-lcurl")
# Licensing
Cyclone is available under the [MIT license](http://www.opensource.org/licenses/mit-license.php).