Re: lablgtk2 + lablgl + native code on Mac

Philippe Strauss <[email protected]>
Newsgroups gmane.comp.lang.ocaml.lib.gtk
Message-ID <[email protected]>
On Fri, Jul 11, 2008 at 11:51:28AM -0700, Jeffrey Scofield wrote:
> Folks:
> 
> I'm having a little trouble building a native code executable
> for lablgtk2 + lablgl on my Mac (Intel, Mac OS X 10.5.4).  If
> anybody has gotten this to work, could you describe what you did?
> Bytecode executables work fine after a little trial and error
> with the link step.

Hello Jeffrey,

here's a simple build script:

MLLIBS=/opt/godi/lib/ocaml
GL="$MLLIBS/pkg-lib/lablGL"
EXT="$MLLIBS/site-lib/extlib"
OSX_GL_DYLIB="-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"

ocamlopt -I $EXT -I +lablgtk2 -I $GL -ccopt "$OSX_GL_DYLIB" -o glplot \
extLib.cmxa lablgtk.cmxa lablgl.cmxa lablgtkgl.cmxa gtkInit.cmx glplot.ml


> I have gotten native executables to work for lablgl alone, but
> they are for the native GUI.  It seems that lablgtk2 needs to
> work on top of X, which is confusing things (at least for me).
> I would be happy with either the native Mac GUI or X interface.

you firts must compile gtkglarea 1.99 and then configure/rebuild lablgtk2 to
enable gtkglarea support.

I've yet been able to bypass the OSX X-Window layer using:
http://developer.imendio.com/projects/gtk-macosx
I was not able to compile gtkglarea-1.99 against gtk-macosx, and given
up for now.

> The main difficulty (I think) is in some kind of Apple problem
> with the OpenGL libraries.  There is a mysterious workaround that
> works for lablgl, but I can't see how to apply it to this new
> situation.

maybe it's this you're refering:

http://developer.apple.com/qa/qa2007/qa1567.html

regards.

-- 
Philippe Strauss
http://philou.ch
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.