compiling multifile program

From: Lyn A Headley (
Date: Sat Apr 12 1997 - 03:04:44 MET DST

Message-Id: <>
Subject: compiling multifile program
Date: Fri, 11 Apr 1997 20:04:44 -0500
From: Lyn A Headley <>

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[i],[i], and

let ent () = "hey";;

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

let str () = "hi";;

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

the "main file"
let s1 = Qstring2.str() and
    e1 = Entry2.ent() in

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:

INCLUDES= #all relevant -I options here
OCFLAGS=$(INCLUDES) -custom str.cma 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

        $(OCC) -c $<

        $(OCC) -c $<

QUIZ_OBJS= entry2.cmo qstring2.cmo

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

        rm -f *.cm[iox]

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

include .depend

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