From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 64ACFBB81 for ; Wed, 29 Dec 2004 17:47:11 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iBTGlAk4027880 for ; Wed, 29 Dec 2004 17:47:11 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA20410 for ; Wed, 29 Dec 2004 17:47:10 +0100 (MET) Received: from slinky.cs.nyu.edu (SLINKY.CS.NYU.EDU [128.122.20.14]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iBTGl90g009324 for ; Wed, 29 Dec 2004 17:47:10 +0100 Received: from localhost (localhost [127.0.0.1]) by slinky.cs.nyu.edu (8.12.10+Sun/8.12.10) with ESMTP id iBTGl9W3009844; Wed, 29 Dec 2004 11:47:09 -0500 (EST) Date: Wed, 29 Dec 2004 11:47:08 -0500 (EST) From: Igor Pechtchanski Reply-To: caml-list@inria.fr To: Jeff Shaw Cc: caml-list@inria.fr Subject: Re: [Caml-list] I'm having trouble compiling independent executables In-Reply-To: <000301c4ed48$d4cd5070$6600a8c0@gft> Message-ID: References: <000301c4ed48$d4cd5070$6600a8c0@gft> Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 41D2DF8E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41D2DF8D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 ocaml:01 ocaml:01 wrote:01 ocamlc:01 stand-alone:01 ocamlc:01 -custom:01 ocamlopt:01 mingw:01 ocamlopt:01 fwiw:01 binutils:01 -custom:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Tue, 28 Dec 2004, Jeff Shaw wrote: > Hi there, this is my first post. I'm a college student who learned OCaml last > semester and likes it a lot. I'm a lingusitics student, so my programming > knowledge is limited, but I enjoyed learning OCaml a LOT more than C++. For > fun this winter break I wrote an RPN calculator, and I would like to compile > it to run independently of any OCaml installation. I have both Visual Studio > .NET 2003 and cygwin installed. I've googled for the errors I'm getting and I > can't seem to find anything helpful. > > First of all, "ocamlc rpn.ml" always works. But it won't run on a machine that > doesn't have ocaml installed. The two ways I've read of to make stand-alone > executables are "ocamlc -custom" and "ocamlopt." I have gotten neither to work > in all three ways of using OCaml in windows: MSVC, MinGW, and cygwin. > > [snip MSVC compile] > > On to cygwin... I've tried recompiling and installing ocaml from source, but > that doesn't fix the problems. Is there a reason why you don't use the official Cygwin "ocaml" package? I had no problem running ocamlopt on Cygwin (in fact, the whole package was built using ocamlopt). FWIW, the Cygwin packages sources contain some modifications to the build scripts that let them use Cygwin's binutils, etc. (BTW, which sources *did* you use?) > ocamlc -custom rpn.ml > "/usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/../../../../i686-pc-cygwin/bin/ld > cannot find -lcamlrun > collect2: ld returned 1 exit status > Error while building custom runtime system" > > ocamlopt rpn.ml > "cannot find file libasmrun.a" Looks like a library path problem. Try adding appropriate -L flags... > I put the file on my PATH ( PATH=";/usr/local/lib/ocaml ) but that > doesn't fix it. I add the file to the command line, but that doesn't fix > it either. > MinGW version of ocaml... > > ocamlc -custom rpn.ml does not have access to gcc, which is in cygwin > only, so it doesn't work. You need to modify it to use "gcc -mno-cygwin", which build MinGW executables (yes, even under Cygwin -- install the gcc-mingw package). There's also a MinGW-only version of gcc/binutils -- see . > ocamlopt rpn.ml > "'as' is not recognized as an internal or external command, operable program or batch file. > Assembler error, input left in file C:\DOCUME~1\jeff\LOCALS~1\Temp\camlasm4af23d.s" Same as above -- you need MinGW binutils. > BTW my source does not need any special modules; the program runs using > only what's available in Pervasives. I'd first try removing your self-built OCaml and installing the Cygwin "ocaml" package. It should also pull in all the necessary Cygwin packages (e.g., gcc, binutils). If there are still problems with your build after that, please report it as a bug to the main Cygwin list (). > Any help would be appreciated! > Jeff HTH, Igor Pechtchanski, the Cygwin OCaml maintainer -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha@cs.nyu.edu ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "The Sun will pass between the Earth and the Moon tonight for a total Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT