compiling multifile program

From: Lyn A Headley (laheadle@midway.uchicago.edu)
Date: Sat Apr 12 1997 - 03:04:44 MET DST


Message-Id: <199704120104.UAA07997@kimbark.uchicago.edu>
To: caml-list@inria.fr
Subject: compiling multifile program
Date: Fri, 11 Apr 1997 20:04:44 -0500
From: Lyn A Headley <laheadle@midway.uchicago.edu>

ok, so I tried to compile the simplest multifile program I could
think of, and I still get the "Undefined Global" error. The files
are entry2.ml[i], qstring2.ml[i], and response2.ml

file entry2.ml:
let ent () = "hey";;

file entry2.mli:
val ent: unit -> string;;

file qstring2.ml:
let str () = "hi";;

file qstring2.mli:
val str: unit -> string;;

the "main file" response2.ml:
let s1 = Qstring2.str() and
    e1 = Entry2.ent() in
3;;

The error is:

Error while linking response2.cmo: Reference to undefined global `Qstring2'
make: *** [all] Error 2

If anyone could help, I would much appreciate it.
ocaml 1.04 SGI Irix 5.2

Lyn Headley

In case it should matter, Here's the Makefile:

OCC=ocamlc
OCDEP=ocamldep
INCLUDES= #all relevant -I options here
OCFLAGS=$(INCLUDES) -custom str.cma response2.ml unix.cma -cclib -lunix -cclib -lstr
# quiz should be compiled to bytecode, and is composed of three
# units: mod1, mod2 and mod3.

# Common rules
.SUFFIXES: .ml .mli .cmo .cmi

.mli.cmi:
        $(OCC) -c $<

.ml.cmo:
        $(OCC) -c $<

QUIZ_OBJS= entry2.cmo qstring2.cmo

all: $(QUIZ_OBJS)
        $(OCC) $(OCFLAGS) $(QUIZ_OBJS)

clean:
        rm -f *.cm[iox]

depend:
        $(OCDEP) $(INCLUDES) *.mli *.ml > .depend

include .depend



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:10 MET