caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* (no subject)
@ 2003-10-23  8:31 ronniec95
  0 siblings, 0 replies; only message in thread
From: ronniec95 @ 2003-10-23  8:31 UTC (permalink / raw)
  To: caml-list

Compiling native binaries on win32.

Though I'm not guaranteeing anything. I got the following to work for my
project but you'll need to make relevant changes.

It's an interface to a proprietary messaging system which is what talarian_intf.cpp
is.

This is main.cpp
#include <caml/mlvalues.h>
#include <caml/callback.h>
#include <stdio.h>


int main(int argc,char** argv)
{
	caml_startup(argv);
	callback(*caml_named_value("main"),Val_unit);
	return 0;
}
---------
This is main.ml

let main () = print_string "Hello World"

let _ =
    Callback.register "main" main

---------
this is the makefile


OCAML = ocamlopt
CC = cl /MT /Ox
OFLAGS = -c -output-obj
OCLINKFLAGS =
OBJECTS = talarian_intf.obj cppmain.obj
CAMLOBJECTS = main.cmx
INTERFACES = Talarian.cmi
LIBPATH=-LIBPATH:e:/Local/"Objective Caml"/lib \
		-LIBPATH:C:/"Program Files"/Talarian/ss62/lib/i86_w32 \
		-LIBPATH:C:/"Program Files"/"Microsoft Visual Studio"/VC98/LIB \
		-LIBPATH:C:/"Program Files"/"Microsoft Visual Studio"/VC98/MFC/LIB \
      	-LIBPATH:C:/"Program Files"/"Microsoft Visual Studio"/VC98/ATL/LIB

INCLUDE=-IE:/Local/"Objective Caml"/lib \
		-IC:/"Program Files"/Talarian/ss62/include \
		-IC:/"Program Files"/"Microsoft Visual Studio"/VC98/INCLUDE \
		-IC:/"Program Files"/"Microsoft Visual Studio"/VC98/MFC/INCLUDE \
		-IC:/"Program Files"/"Microsoft Visual Studio"/VC98/ATL/INCLUDE \

LINKFLAGS =  ${LIBPATH} E:/Local/"Objective Caml"/lib/std_exit.obj stdlib.lib
tipc.lib tutil.lib libasmrun.lib libunix.lib advapi32.lib wsock32.lib camlprog.obj
/NOLOGO /subsystem:console /machine:I386
TARGET = go.exe

all : ${TARGET}

clean :
	rm -f ${CAMLOBJECTS}
	rm -f ${INTERFACES}
	rm -f *.cmi
	rm -f *.cmo
	rm -f *.obj
	rm -f *~

${TARGET} : ${OBJECTS} ${INTERFACES} ${CAMLOBJECTS} camlprog.obj
	link  ${OBJECTS}  /OUT:${TARGET} ${LINKFLAGS}

camlprog.obj : ${CAMLOBJECTS}
	${OCAML} -output-obj -o camlprog.obj unix.cmxa ${CAMLOBJECTS}

%.cmx : %.ml
	${OCAML} ${OFLAGS} $<

%.cmi : %.mli
	${OCAML} -c $<

%.obj : %.c
	${CC} ${INCLUDE} -c $<


Ronnie


-------------------
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] only message in thread

only message in thread, other threads:[~2003-10-23  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-23  8:31 ronniec95

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).