Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
compiling multifile program
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Lyn A Headley <laheadle@m...>
Subject: compiling multifile program
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