caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] -custom linking against -lncurses?
@ 2012-11-30  9:31 Malcolm Matalka
  2012-11-30 14:59 ` Gerd Stolpmann
  0 siblings, 1 reply; 2+ messages in thread
From: Malcolm Matalka @ 2012-11-30  9:31 UTC (permalink / raw)
  To: caml-list

I have noticed on my machine, ocamlc, using -custom, tries to link the
resulting code against ncurses[1].

Is this behaviour expected?  I know how to get around this on my OS but
not sure why it's happening in the first place.

/Malcolm 

[1]
malcolm@nix-junkyard:/tmp$ ocamlc -o foo foo.ml
malcolm@nix-junkyard:/tmp$ ocamlc -custom -o foo foo.ml
/nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ld:
cannot find -lncurses
collect2: ld returned 1 exit status
File "foo.ml", line 1, characters 0-1:
Error: Error while building custom runtime system

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

* Re: [Caml-list] -custom linking against -lncurses?
  2012-11-30  9:31 [Caml-list] -custom linking against -lncurses? Malcolm Matalka
@ 2012-11-30 14:59 ` Gerd Stolpmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Stolpmann @ 2012-11-30 14:59 UTC (permalink / raw)
  To: Malcolm Matalka; +Cc: caml-list

It's a configure-time issue: Look at the output of "ocamlc -config", and
you see an -lncurses in bytecomp_c_libraries. Basically, the curses
library is only needed for the toploop (for accessing terminfo), but as
the toploop uses the bytecode compiler, the -lncurses option is
propagated to all bytecode programs. I guess this is for simplicity of
the runtime system.

You can get rid of that by passing -no-curses to the "configure" script
when you build ocaml.

Gerd

Am Freitag, den 30.11.2012, 04:31 -0500 schrieb Malcolm Matalka:
> I have noticed on my machine, ocamlc, using -custom, tries to link the
> resulting code against ncurses[1].
> 
> Is this behaviour expected?  I know how to get around this on my OS but
> not sure why it's happening in the first place.
> 
> /Malcolm 
> 
> [1]
> malcolm@nix-junkyard:/tmp$ ocamlc -o foo foo.ml
> malcolm@nix-junkyard:/tmp$ ocamlc -custom -o foo foo.ml
> /nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ld:
> cannot find -lncurses
> collect2: ld returned 1 exit status
> File "foo.ml", line 1, characters 0-1:
> Error: Error while building custom runtime system
> 

-- 
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html
Company homepage:       http://www.gerd-stolpmann.de
*** Searching for new projects! Need consulting for system
*** programming in Ocaml? Gerd Stolpmann can help you.
------------------------------------------------------------


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

end of thread, other threads:[~2012-11-30 14:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30  9:31 [Caml-list] -custom linking against -lncurses? Malcolm Matalka
2012-11-30 14:59 ` Gerd Stolpmann

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).