Skip to content

Commit

Permalink
Merge pull request #4632 from bigos/patch-1
Browse files Browse the repository at this point in the history
Update ffi.rst to show example of correct including C code and exampl…
  • Loading branch information
melted committed Dec 26, 2018
2 parents 32940be + a0a9b79 commit 03d9188
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/reference/ffi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,24 @@ For C, this is:
FFI_C : FFI
FFI_C = MkFFI C_Types String String
Linking foreign code
====================

This is the example of linking C code.

.. code-block:: idris
%include C "mylib.h"
%link C "mylib.o"
Example Makefile

.. code-block:: shell
DEFAULT: mylib.o main.idr
idris main.idr -o executableFile
clean:
rm -f executableFile mylib.o main.ibc
Foreign calls
=============

Expand Down

0 comments on commit 03d9188

Please sign in to comment.