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

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 12, 2013

Comment author: @damiendoligez

Added a sentence to the manual (rev 13992).

@vicuna vicuna closed this Dec 11, 2015

@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.