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] Filename.quote - again
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-15 (13:26)
From: Andrej Bauer <Andrej.Bauer@a...>
Subject: Re: [Caml-list] Re: Filename.quote - again

Vitaly Lugovsky <> writes:
> $ocamlc -custom -linkall -o ocamltktop -I ../support \
>     -ccopt -L../support -cclib -lcamltk -ccopt "" \
>  -cclib "-ltk8.3 -ltcl8.3 -ldl " -ccopt " -L/usr/X11R6/lib" \
>  -cclib " -lSM -lICE -lX11  -lm" \
>  toplevellib.cma camltk.cma topmain.cmo
> i586-alt-linux-gcc:  -lSM -lICE -lX11  -lm: No such file or directory
> i586-alt-linux-gcc:  -lSM -lICE -lX11  -lm: No such file or directory
> Error while building custom runtime system
>  With '-verbose' option I got something like
> gcc ... ' -L/usr/X11R6/lib ' ' -lSM -lICE -lX11  -lm' ...
>                              ^^^^^^^^^^^^^^^^^^^^^^^^ 
>  gcc treats this as a file name, not as an options, thanx
> to the single quotes.

Instead of using a single -cclib to pass three C libraries at the same
time (which you noted doesn't work), you should use -cclib three
times, once for each library:

camlc -custom -linkall -o ocamltktop -I ../support \
      -ccopt -L../support -cclib -lcamltk -ccopt "" \
      -cclib "-ltk8.3" -cclib "-ltcl8.3" -cclib "-ldl "
      -ccopt "-L/usr/X11R6/lib" \
      -cclib "-lSM" -cclib "-lICE" -cclib "-lX11"  -cclib "-lm" \
      toplevellib.cma camltk.cma topmain.cmo

Since there could be a library with a space or a single quote in its
name, ocaml does the correct thing. How is it supposed to know that
your library is not called "SM -lICE -lX11 -lm"? I admit only a crazy
person would create such a library, but that is irrelevant.

Andrej Bauer
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: