So far I've done...
ocamlc test.mli
cc -c -I/opt/local/lib/ocaml test.m (* This is an Objective C file *)
ocamlmklib test.o -o test.cma
ocaml test.cma test-test.ml
This results in "The external function `string_to_NSString' is not
available".
Source:
(*test.mli*)
type nsstring
external string_to_nsstring : string -> nsstring = "string_to_NSString"
external nsstring_to_string : nsstring -> string = "NSString_to_string"
(*test.m*)
#import <Foundation/NSString.h>
#ifndef CAMLHEADERS
#define CAMLHEADERS
#include <caml/mlvalues.h>
#include <caml/alloc.h>
#include <caml/memory.h>
#include <caml/fail.h>
#include <caml/callback.h>
#include <caml/custom.h>
#include <caml/intext.h>
#endif
NSString* string_to_NSString(value s)
{
NSString *ns;
[ns initWithUTF8String: String_val(s)];
CAMLreturn(ns);
}
value NSString_to_string(NSString *ns)
{
char *s = [ns UTF8String];
value camls = copy_string(s);
CAMLreturn(camls);
}
(*test-test.ml*)
open Test;;
let s = "hello";;
print_endline s;;
let ns = string_to_nsstring s;;
let origs = nsstring_to_string ns;;
print_endline origs;;
(* end files *)
Yes, I'm playing with mixing Mac OS X's Objective C libraries with
ocaml. 
Any ideas about how to get ocaml to see my c functions?
.