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
Strange compilation problem
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-11 (15:15)
From: Matthieu Dubuget <matthieu.dubuget@g...>
Subject: Re: [Caml-list] Re: Strange compilation problem (flexlink trying to deal with windows and cygwin shell limitations)
Christoph Bauer a écrit :
> I added -L$(cygpath -m /usr/lib/w32api) somewhere in the command lin while linking.
> Does this help? (Maybe as -cclib  -L$(cygpath -m /usr/lib/w32api))
> Regards,
> Christoph Bauer

No :-/

But I think I understood the problem. flexlink tries a lot of paths.
And if the file is not found, a cygpath conversion is tried before
a second search.

This cygpath conversion is done through a file redirection.

> let get_output cmd =
>   let fn = Filename.temp_file "flexdll" "" in
>   if (Sys.command (cmd ^ " > " ^ fn) < 0)
>   then failwith ("Cannot run " ^ cmd);
>     let r = read_file fn in
>       Sys.remove fn;
>       r

In my case fn is void, and cmd is… long.

String.length cmd gives 8406 ie > 8k

I'm pretty sure that I could have my app. compiled
by using a site-lib directory near the root of the filesystem.