caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: "'Alan Schmitt'" <alan.schmitt@polytechnique.org>,
	"'caml-list@inria.fr'" <caml-list@inria.fr>
Subject: RE: [Caml-list] Specifying a framework to link with using ocamlopt?
Date: Wed, 23 Feb 2011 13:59:57 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9490F7737@Remus.metastack.local> (raw)
In-Reply-To: <2E007446-C7AD-46D6-8F9C-1377533EF156@polytechnique.org>

Alan Schmitt wrote:
> I'm trying to compile a simple program using glMLite, and I cannot seem
> to find a way to tell ocamlopt to use the OS X framework I specify.
> 
> If I don't say anything, I get (an expected) error:
> 
> [:)][top] % ocamlopt -I +glMLite GL.cmxa Glut.cmxa triangle.ml  -o
> triangle.exe
> ld: library not found for -lGL

I know very little about how OS X works internally (or externally, for that matter!) but presumably -lGL is not the appropriate way to link against this library on OSX given the error? This would imply, as Daniel said, that the .cmxa file has been incorrectly compiled (linker options are stored in the "manifest" of the file).

> If I try to tell the linker where the library is, I still get the same
> error:
> 
> [:(][top] % ocamlopt -cclib "-framework OpenGL" -I +glMLite GL.cmxa
> Glut.cmxa triangle.ml  -o triangle.exe
> ld: library not found for -lGL
> collect2: ld returned 1 exit status
> File "caml_startup", line 1, characters 0-1:
> Error: Error during linking
> 
> In fact, it seems the "-framework" option is simply ignored:

Not necessarily - even if "-framework OpenGL" is working then the linker must still obey "-lGL" (it can't simply ignore it). Try including -verbose in your ocamlopt switches - this will display the calls to all external programs and you'll be able to verify that "-framework OpenGL" is indeed being passed to the linker (it should be, though). 


David


  parent reply	other threads:[~2011-02-23 14:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 13:10 Alan Schmitt
2011-02-23 13:33 ` Daniel Bünzli
2011-02-23 13:40   ` Daniel Bünzli
2011-02-23 14:12   ` Alan Schmitt
2011-02-23 13:59 ` David Allsopp [this message]
2011-02-23 14:21   ` Alan Schmitt
2011-02-23 14:19     ` David Allsopp
2011-02-23 15:21       ` Alan Schmitt
2011-02-23 15:48         ` David Allsopp
2011-02-23 16:08           ` Alan Schmitt
2011-02-23 16:08             ` David Allsopp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D9490F7737@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=alan.schmitt@polytechnique.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).