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
[Caml-list] Directory problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Directory problems
> I have the VC++ port of Ocaml3.1 and cygwin installed. When I try to
> make a custom toplevel with ocamlmktop including labltk the linker
> alwasy looks for Tk83.lib and Tcl83.lib in the directory
> c:\tcl\lib. But I have installed Tcl at another location. I tried to
> set TCL_LIBRARY and TK_LIBRARY accordingly but this didn't change
> anything.

Yes, this is a problem with the new "autolink" feature in OCaml 3.01:
you don't have to specify external C libraries, but their paths are
hard-wired in the binary distribution (in the .cma file, actually).

> The only workaround is to place the libs where the linker
> is looking for.

Another workaround is:

ocamlc -noautolink -I +labltk labltk.cma <your files> \
  -cclib -llabltk41 \my\path\to\tk83.lib \my\path\to\tcl83.lib

> The second problem I have with cygwin make is that the ocaml tools
> are not able to find files when absolute paths are given.  For
> example ../dir works but /cygdrive/d/projects/dir does not. I also
> tried "d:\projects\dir" but this didn't work either. I can place the
> *.cma or *.cmx files in a directory that I can reach without
> specifying absolute paths but this is not the most elegant method.

I believe this is a Cygwin problem.  The Win32 port of OCaml doesn't
do anything special with the file names given on the command line:
they are passed straight to the Win32 system calls.  Try invoking
OCaml from a Windows "command" shell and see if it works.

Cygwin does do all sorts of transformations over file names when a
Cygwin program (e.g. bash) launches a non-Cygwin program (e.g. ocamlc).
This is because Cygwin has its own view of the file system, with
Unix-like mount points and so on.  On some versions of Cygwin that
I've used, these file name conversions are quite strange, if not
downright buggy, e.g. the Win32 command does not receive the correct
Win32 equivalent of the file specified on the command line.
The only way I got it to work is to mount "C:\" on "/" and have all my
files on C:.  As usual with Cygwin, your mileage may vary...

- Xavier Leroy
To unsubscribe, mail  Archives: