Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* dynamic linking and C libraries
@ 1998-01-27  3:54 Scott Alexander
  1998-02-10 20:23 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Scott Alexander @ 1998-01-27  3:54 UTC (permalink / raw)
  To: caml-list

I am having a problem when I try to dynamically link code which uses
functions from C libraries (externals).  I sometimes get a message like:

The external function `is_digit_odd' is not available

My workaround for this is to call the function in some statically linked
part of the program.  Is there a better fix for this problem?

Thanks,
Scott Alexander
salex@dsl.cis.upenn.edu





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: dynamic linking and C libraries
  1998-01-27  3:54 dynamic linking and C libraries Scott Alexander
@ 1998-02-10 20:23 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1998-02-10 20:23 UTC (permalink / raw)
  To: Scott Alexander; +Cc: caml-list

> I am having a problem when I try to dynamically link code which uses
> functions from C libraries (externals).  I sometimes get a message like:
> 
> The external function `is_digit_odd' is not available
> 
> My workaround for this is to call the function in some statically linked
> part of the program.  Is there a better fix for this problem?

Try using the "-linkall" option to ocamlc when linking your main
application (the one that does the dynamic linking).

The "-linkall" option disables the normal elimination of unused
modules and C primitives, and makes sure that all the modules and
libraries you mention on the command line are linked in and thus
available to dynamically-linked code.  (The accompanying C primitives
are dragged in the executable along the way.)

Hope this helps.

- Xavier Leroy





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-02-13 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-27  3:54 dynamic linking and C libraries Scott Alexander
1998-02-10 20:23 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox