Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example of linking C main with OCaml runtime needs additional libraries #4920

Closed
vicuna opened this issue Nov 15, 2009 · 3 comments
Closed

Comments

@vicuna
Copy link

vicuna commented Nov 15, 2009

Original bug ID: 4920
Reporter: ecc
Status: closed (set by @xavierleroy on 2015-12-11T18:23:48Z)
Resolution: fixed
Priority: normal
Severity: text
Version: 3.11.1
Target version: 4.01.0+dev
Fixed in version: 4.01.0+dev
Category: documentation

Bug description

In the manual chapter "Interfacing C with Objective Caml", subsection "Advanced topic: callbacks from C to Caml", sub-subsection "Embedding the Caml code in the C code":

  1. It's not necessary to include unix.cma in the ocamlopt command, or -lunix in the gcc command (unless required by the OCaml code, of course)

  2. It is necessary to add both "-lm" and "-ldl" at the end of the gcc command line.

(on Linux, at least)

@vicuna
Copy link
Author

vicuna commented Feb 10, 2012

Comment author: @damiendoligez

About (1): I think that's quite clear from the manual: it includes this sentence:

For instance, assume the OCaml part of your program uses the Unix library.

@vicuna
Copy link
Author

vicuna commented Aug 12, 2013

Comment author: @damiendoligez

About (2): on Mac OS X, I don't need "-lm" nor "-ldl". I need "-lcurses" but only in the byte-code case...

@vicuna
Copy link
Author

vicuna commented Aug 12, 2013

Comment author: @damiendoligez

Added a sentence to the manual (rev 13992).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant