caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] interface C and OCaml
@ 2002-06-18 12:02 Yunming.WANG
  2002-06-18 12:58 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Yunming.WANG @ 2002-06-18 12:02 UTC (permalink / raw)
  To: caml-list

Hi,

I'm a beginner.  Please help me to resove the problem.  Thank you.

D:\ocaml\oc\myself>echo %OS%
Windows_NT

D:\ocaml\oc\myself>type callc.ml
external plus : int -> int -> int -> int = "myPlus";;
print_int (plus 1 2 3) ;;
print_newline () ;;

D:\ocaml\oc\myself>type calledbycaml.c
#include <stdio.h>
#include <caml/mlvalues.h>
CAMLprim value myPlus (value x1,value x2,value x3)
{
        return Val_long ( Long_val(x1) + Long_val(x2) + Long_val(x3));
}

D:\ocaml\oc\myself>cl -c -I%OCAMLLIB% calledbycaml.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

calledbycaml.c

D:\ocaml\oc\myself>ocamlc -o tyr.exe calledbycaml.obj callc.ml
Error while linking callc.cmo:
The external function `myPlus' is not available


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] interface C and OCaml
  2002-06-18 12:02 [Caml-list] interface C and OCaml Yunming.WANG
@ 2002-06-18 12:58 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 2002-06-18 12:58 UTC (permalink / raw)
  To: Yunming.WANG; +Cc: caml-list

> D:\ocaml\oc\myself>ocamlc -o tyr.exe calledbycaml.obj callc.ml
> Error while linking callc.cmo:
> The external function `myPlus' is not available

Add the "-custom" option.

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2002-06-18 12:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-18 12:02 [Caml-list] interface C and OCaml Yunming.WANG
2002-06-18 12:58 ` Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).