caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* windows and C libs
@ 2007-06-20 13:37 Christophe TROESTLER
  2007-06-21  6:43 ` [Caml-list] " Dmitry Bely
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe TROESTLER @ 2007-06-20 13:37 UTC (permalink / raw)
  To: O'Caml Mailing List

Hi,

WINDOWS USERS: Is there a consensus on windows on where the .lib and
.dll should go?  If not, how about to decide that here so efforts to
port libs to windows can set it as the default path.

WIN32 OCAML: When I give a path -- say -cclib "C:\Documents and
Settings\USER\Mes documents\lib\libx.lib" -- containing spaces (but
quoted) to include into a library, it is not well quoted when on uses
the library (to compile a program).  I tried "\"...\"" to  not avail.
Is there a way around that or must it be considered like a bug?

Regards,
ChriS


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] windows and C libs
  2007-06-20 13:37 windows and C libs Christophe TROESTLER
@ 2007-06-21  6:43 ` Dmitry Bely
  2007-06-21  8:35   ` Christophe TROESTLER
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Bely @ 2007-06-21  6:43 UTC (permalink / raw)
  To: Caml List

On 6/20/07, Christophe TROESTLER <Christophe.Troestler@umh.ac.be> wrote:

> WINDOWS USERS: Is there a consensus on windows on where the .lib and
> .dll should go?  If not, how about to decide that here so efforts to
> port libs to windows can set it as the default path.

Do you mean .lib/.dll files of some specific OCaml library? They
usually go to %OCAMLLIB% and  %OCAMLLIB%\stublibs respectively. What's
wrong with it?

> WIN32 OCAML: When I give a path -- say -cclib "C:\Documents and
> Settings\USER\Mes documents\lib\libx.lib" -- containing spaces (but
> quoted) to include into a library, it is not well quoted when on uses
> the library (to compile a program).  I tried "\"...\"" to  not avail.
> Is there a way around that or must it be considered like a bug?

An obvious workaround is to use the short name:
C:\Docume~1\USER\Mesdoc~1\lib\libx.lib

- Dmitry Bely


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] windows and C libs
  2007-06-21  6:43 ` [Caml-list] " Dmitry Bely
@ 2007-06-21  8:35   ` Christophe TROESTLER
  2007-06-21 18:48     ` Dmitry Bely
  0 siblings, 1 reply; 5+ messages in thread
From: Christophe TROESTLER @ 2007-06-21  8:35 UTC (permalink / raw)
  To: caml-list

On Thu, 21 Jun 2007, "Dmitry Bely" <dmitry.bely@gmail.com> wrote:
> 
> On 6/20/07, Christophe TROESTLER <Christophe.Troestler@umh.ac.be> wrote:
> 
> > WINDOWS USERS: Is there a consensus on windows on where the .lib and
> > .dll should go?  If not, how about to decide that here so efforts to
> > port libs to windows can set it as the default path.
> 
> Do you mean .lib/.dll files of some specific OCaml library? They
> usually go to %OCAMLLIB% and  %OCAMLLIB%\stublibs respectively. What's
> wrong with it?

No, I mean C library files -- e.g. where should the C-pcre libraries
(libpcre.lib, dllpcre.dll) go?

> > WIN32 OCAML: When I give a path -- say -cclib "C:\Documents and
> > Settings\USER\Mes documents\lib\libx.lib" -- containing spaces (but
> > quoted) to include into a library, it is not well quoted when on uses
> > the library (to compile a program).  I tried "\"...\"" to  not avail.
> > Is there a way around that or must it be considered like a bug?
> 
> An obvious workaround is to use the short name:
> C:\Docume~1\USER\Mesdoc~1\lib\libx.lib

Yes but it is not convenient because it is not returned by, say,
%OCAMLLIB%.  Is there a command to transform a long name into a short
one?  What about vista?

Thanks,
ChriS


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] windows and C libs
  2007-06-21  8:35   ` Christophe TROESTLER
@ 2007-06-21 18:48     ` Dmitry Bely
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Bely @ 2007-06-21 18:48 UTC (permalink / raw)
  To: caml-list

On 6/21/07, Christophe TROESTLER <Christophe.Troestler+ocaml@umh.ac.be> wrote:

> > > WINDOWS USERS: Is there a consensus on windows on where the .lib and
> > > .dll should go?  If not, how about to decide that here so efforts to
> > > port libs to windows can set it as the default path.
> >
> > Do you mean .lib/.dll files of some specific OCaml library? They
> > usually go to %OCAMLLIB% and  %OCAMLLIB%\stublibs respectively. What's
> > wrong with it?
>
> No, I mean C library files -- e.g. where should the C-pcre libraries
> (libpcre.lib, dllpcre.dll) go?

They are library files to link with Ocaml programs, aren't they?
(otherwise why are you duplicating Ocaml naming convention). If yes I
believe my advice is correct - you should install C glue libraries
into the locations mentioned above (you may use %OCAMLLIB%\xxxx to not
pollute the root lib directory. Then you specify -I +xxxx while
linking).

> > > WIN32 OCAML: When I give a path -- say -cclib "C:\Documents and
> > > Settings\USER\Mes documents\lib\libx.lib" -- containing spaces (but
> > > quoted) to include into a library, it is not well quoted when on uses
> > > the library (to compile a program).  I tried "\"...\"" to  not avail.
> > > Is there a way around that or must it be considered like a bug?
> >
> > An obvious workaround is to use the short name:
> > C:\Docume~1\USER\Mesdoc~1\lib\libx.lib
>
> Yes but it is not convenient because it is not returned by, say,
> %OCAMLLIB%.

Use there the short name also:

set OCAMLLIB=C:\Progra~1\Ocaml\lib

> Is there a command to transform a long name into a short
> one?  What about vista?

Yes, it's possible, but probably still not what you need:

[short.bat]
echo %~s1

C:\Temp>short.bat "C:\Documents and Settings"
C:\DOCUME~1

- Dmitry Bely


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] windows and C libs
       [not found] <20070621094006.51F79BC76@yquem.inria.fr>
@ 2007-06-21 10:29 ` David Allsopp
  0 siblings, 0 replies; 5+ messages in thread
From: David Allsopp @ 2007-06-21 10:29 UTC (permalink / raw)
  To: caml-list

> On Thu, 21 Jun 2007, "Dmitry Bely" <dmitry.bely@gmail.com> wrote:
> > 
> > On 6/20/07, Christophe TROESTLER <Christophe.Troestler@umh.ac.be> wrote:
> > 
> > > WINDOWS USERS: Is there a consensus on windows on where the .lib and
> > > .dll should go?  If not, how about to decide that here so efforts to
> > > port libs to windows can set it as the default path.
> > 
> > Do you mean .lib/.dll files of some specific OCaml library? They
> > usually go to %OCAMLLIB% and  %OCAMLLIB%\stublibs respectively. What's
> > wrong with it?
>
> No, I mean C library files -- e.g. where should the C-pcre libraries
> (libpcre.lib, dllpcre.dll) go?
Same place? It's less well-defined under Windows because it's not a compiler
oriented OS... all the Microsoft Dev. Tools have their own special build
environments that set the relevant variables for where the libs are. AFAIK
there's no "correct" place for them.

> > > WIN32 OCAML: When I give a path -- say -cclib "C:\Documents and
> > > Settings\USER\Mes documents\lib\libx.lib" -- containing spaces (but
> > > quoted) to include into a library, it is not well quoted when on uses
> > > the library (to compile a program).  I tried "\"...\"" to  not avail.
> > > Is there a way around that or must it be considered like a bug?
> > 
> > An obvious workaround is to use the short name:
> > C:\Docume~1\USER\Mesdoc~1\lib\libx.lib
>
> Yes but it is not convenient because it is not returned by, say,
> %OCAMLLIB%.  Is there a command to transform a long name into a short
> one?  What about vista?
>
dir /x returns short names but, alas, it doesn't combine with /b to produce
what you're after. However, cygpath --dos does exactly what you need.
Incidentally, using %OCAMLLIB% is unreliable - 'ocamlc -where' is better as
that will return an answer even for an environment that hasn't defined
OCAMLLIB (which isn't mentioned as being necessary in INSTALL in the source
distribution...)

So, for me, the whole command becomes:
for /f "delims=" %F in ('ocamlc -where') do @c:\cygwin\bin\cygpath -d "%F"



David


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-21 18:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-20 13:37 windows and C libs Christophe TROESTLER
2007-06-21  6:43 ` [Caml-list] " Dmitry Bely
2007-06-21  8:35   ` Christophe TROESTLER
2007-06-21 18:48     ` Dmitry Bely
     [not found] <20070621094006.51F79BC76@yquem.inria.fr>
2007-06-21 10:29 ` David Allsopp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).