Go-OpenGL Linking Problems

156 views
Skip to first unread message

ikuz

unread,
Aug 8, 2011, 5:20:14 PM8/8/11
to golang-nuts
Hi,

I have been trying to get Go-OpenGL up and running on OSX but have
been having a few problems linking, etc.

I've installed GLEW 1.5.8 using brew (also tried 1.6.0 from GLEW site
but got same problems).

gomake issues the command:

> gcc -m32 -g -fPIC -O2 -o _cgo1_.o _cgo_main.o gl.cgo2.o _cgo_export.o -framework OpenGL -lGLEW -lGL

and complains it cannot find GL libraries.

Adding the location of the GL library manually to the command

> gcc -m32 -g -fPIC -L/System/Library/Frameworks/OpenGL.framework/Libraries -O2 -o _cgo1_.o _cgo_main.o gl.cgo2.o _cgo_export.o -framework OpenGL -lGLEW -lGL

picks up the GL location ie running the following from the gl
directory enables picks up the GL libraries, but if barfs on GLEW with

> ld: warning: in /usr/lib/libGLEW.dylib, file is not of required architecture

Questions:
- Has anyone else had these problems?
- Am I pointing to the right place to pick up libGL?
- Why does gcc not pick up libGL with -framework OpenGL (am a newbie
to OSX)?
- How do I fix the architecture of GLEW?

Many thanks for any help

Peter

ikuz

unread,
Aug 11, 2011, 5:19:24 PM8/11/11
to golang-nuts
Found the problem. Was using 8g (32 bit) not 6g (64 bit). GLEW was
compiled as 64 bit. Switched to 6g and problem solved.
Reply all
Reply to author
Forward
0 new messages