From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA22969; Tue, 3 Dec 2002 08:44:45 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA22667 for ; Tue, 3 Dec 2002 08:44:45 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gB37iiX10316; Tue, 3 Dec 2002 08:44:44 +0100 (MET) Received: from tintin.inria.fr (tintin.inria.fr [128.93.24.126]) by pauillac.inria.fr (8.7.6/8.7.3) with SMTP id IAA22980; Tue, 3 Dec 2002 08:44:43 +0100 (MET) Date: Tue, 3 Dec 2002 08:44:43 +0100 From: Maxence Guesdon To: "altavillasalvatore@libero.it" , caml-list@inria.fr Subject: Re: [Caml-list] compilation problem Message-Id: <20021203084443.7df47f39.maxence.guesdon@inria.fr> In-Reply-To: References: Organization: INRIA X-Mailer: Sylpheed version 0.8.6claws (GTK+ 1.2.10; ) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > **** > pascal.ml > open Unix > let my_name =Unix.gethostname();; > ****** > I type > > ocamlc -custom unix.cma pascal.ml -cclib -lunix > > and then > > ocamlc pascal.ml -o pascal > > obtaining the following message: > > Reference to undefined global `Unix' > > I would want the exec -file. The first command you typed is also used to create an executable (by default a.out), since you did not provide the -c (compile only) or -a (create a library) flags. Change the first command to : ocamlc -o pascal -custom unix.cma pascal.ml -cclib -lunix to create the executable with the name 'pascal'. You could also have compiled pascal.ml : ocamlc -c pascal.ml (creates pascal.cmo and pascal.cmi) then you could have created an executable with the compiled file : ocamlc -o pascal -custom unix.cma -cclib -lunix pascal.cmo -- Maxence Guesdon ------------------- 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