From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id E6AE47ED67 for ; Sat, 11 Aug 2012 22:15:41 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jeannin@cs.cornell.edu) identity=pra; client-ip=128.84.103.139; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="jeannin@cs.cornell.edu"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jeannin@cs.cornell.edu) identity=mailfrom; client-ip=128.84.103.139; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="jeannin@cs.cornell.edu"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@exch-hub2.cs.cornell.edu) identity=helo; client-ip=128.84.103.139; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="jeannin@cs.cornell.edu"; x-sender="postmaster@exch-hub2.cs.cornell.edu"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmwDAJi8JlCAVGeLbmdsb2JhbABEqFCRTUMigiABAQEEDGILEAIBCBEEAQEODxIyEwoIAQEEDgUICgmHYwMMC65mA1SJBIsShVFgA4gZjTKBFIgYiV8 X-IronPort-AV: E=Sophos;i="4.77,752,1336341600"; d="scan'208";a="169668536" Received: from mail-hub-2.cs.cornell.edu (HELO exch-hub2.cs.cornell.edu) ([128.84.103.139]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 11 Aug 2012 22:15:41 +0200 Received: from gobo.cs.cornell.edu ([128.84.96.141]) by exch-hub2.cs.cornell.edu ([128.84.103.139]) with mapi; Sat, 11 Aug 2012 16:15:39 -0400 From: Jean-Baptiste Jeannin To: =?iso-8859-1?Q?J=E9r=E9mie_Dimino?= CC: "caml-list@inria.fr" Date: Sat, 11 Aug 2012 16:15:24 -0400 Thread-Topic: [Caml-list] Exception Typetexp.Error(_, _) when using Toploop Thread-Index: Ac13nCdzqhu+8AxNSLKspsO6H+JdKwAYeMva Message-ID: References: <50257D72.2090607@cs.cornell.edu>,<20120811103435.3362ceec@locris.home> In-Reply-To: <20120811103435.3362ceec@locris.home> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [Caml-list] Exception Typetexp.Error(_, _) when using Toploop Hi Jeremie and thanks for your answer, If I understand correctly you suggest two possible fixes: First possible fix, copy tree.cmi one level up. I don't like this solution = too much but it works: $ ocamlc -o prog.exe -I subdir toplevellib.cma subdir/tree.ml prog.ml $ ./prog.exe=20 Fatal error: exception Typetexp.Error(_, _) $ cp subdir/tree.cmi . $ ./prog.exe=20 val t : Tree.tree =3D Tree.Leaf Second possible fix, add the line 'Topdirs.dir_directory "subdir";' to prog= .ml. This works great, I prefer it and it solves my problem. Thanks a lot! ________________________________________ From: caml-list-request@inria.fr [caml-list-request@inria.fr] On Behalf Of = J=E9r=E9mie Dimino [jeremie@dimino.org] Sent: Saturday, August 11, 2012 4:34 AM To: Jean-Baptiste Jeannin Cc: caml-list@inria.fr Subject: Re: [Caml-list] Exception Typetexp.Error(_, _) when using Toploop Le Fri, 10 Aug 2012 17:30:26 -0400, Jean-Baptiste Jeannin a =E9crit : > $ cd .. > $ ocamlc -o prog.exe -I subdir toplevellib.cma subdir/tree.ml prog.ml > $ ./prog.exe > Fatal error: exception Typetexp.Error(_, _) It is because it cannot find the interface for the module Tree (which is contained in the file tree.cmi). If you want to compile code at runtime using compiler libraries you need all .cmi for all units you are using in this code. You can add new search paths using Topdirs.dir_directory, which correspond to the #directory directive in the toplevel. Cheers, -- J=E9r=E9mie -- Caml-list mailing list. Subscription management and archives: https://sympa-roc.inria.fr/wws/info/caml-list Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs