From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p1NE5YOB001160 for ; Wed, 23 Feb 2011 15:05:34 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwCAFOjZE1RZ90vkWdsb2JhbACmGRUBAQEBCQsKBxEDIbw6gywCgjAEjBY X-IronPort-AV: E=Sophos;i="4.62,212,1297033200"; d="scan'208";a="88531290" Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Feb 2011 15:05:28 +0100 Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110223140527.OAPL18231.mtaout01-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Wed, 23 Feb 2011 14:05:27 +0000 Received: from romulus.metastack.com ([81.102.132.77]) by aamtaout04-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20110223140527.IAEE25656.aamtaout04-winn.ispmail.ntl.com@romulus.metastack.com>; Wed, 23 Feb 2011 14:05:27 +0000 Received: from remus.metastack.local ([172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id p1NE5Otc014000 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 23 Feb 2011 14:05:24 GMT Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%11]) with mapi; Wed, 23 Feb 2011 14:00:44 +0000 From: David Allsopp To: "'Alan Schmitt'" , "'caml-list@inria.fr'" Thread-Topic: [Caml-list] Specifying a framework to link with using ocamlopt? Thread-Index: AQHL01qCYpWJmFu99k29At0YXZiK7ZQPHCUw Date: Wed, 23 Feb 2011 13:59:57 +0000 Message-ID: References: <2E007446-C7AD-46D6-8F9C-1377533EF156@polytechnique.org> In-Reply-To: <2E007446-C7AD-46D6-8F9C-1377533EF156@polytechnique.org> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 81.102.132.77 X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=cdUUi1lex48A:10 a=kj9zAlcOel0A:10 a=xqWC_Br6kY4A:10 a=4TK4B-oSzX4QEFL4zjMA:9 a=Jra0raRPkj8PjVZeeGAQat1T9XsA:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p1NE5YOB001160 Subject: RE: [Caml-list] Specifying a framework to link with using ocamlopt? 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