caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: ronniec95@lineone.net
To: caml-list@inria.fr
Date: Thu, 23 Oct 2003 09:31:07 +0100	[thread overview]
Message-ID: <3F94F9C4000070F4@mk-cpfrontend-4.mail.uk.tiscali.com> (raw)

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


                 reply	other threads:[~2003-10-23  8:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F94F9C4000070F4@mk-cpfrontend-4.mail.uk.tiscali.com \
    --to=ronniec95@lineone.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).