Sign in to follow this  
Followers 0
ZwodahS

C++ Opengl on Mac OSX

5 posts in this topic

Hi guys,

 

Recently I started learning C++ Opengl and I have encountered problems with setting up certain things

 

I am currently following the examples in http://lazyfoo.net/tutorials/OpenGL/index.php

 

I am very new to C++ but I managed to set up most of the tools/libraries needed. However, I can't seems to install glew properly.

I mainly use vim to code so I do not have a IDE. 

 

Currently in tutorial 15, he introduced glew. I downloaded the latest glew from sourceforge and compile it myself.

When i try to compile it(the example in tutorial 15) gave me the following error

 

g++ *.cpp -o gl -framework GLUT -framework OpenGL -lIL -lILU -lILUT

 

Undefined symbols for architecture x86_64:
  "_glewInit", referenced from:
      initGL()    in ccfz5EFV.o
  "_glewGetErrorString", referenced from:
      initGL()    in ccfz5EFV.o
  "___GLEW_VERSION_2_1", referenced from:
      initGL()    in ccfz5EFV.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [compile] Error 1
 
from my limited knowledge of C++, i think this is a problem with using a 32bit library on a 64bit one. I can't seems to be able to find a solution after few hours of search on google. 
 
Can anyone help ?
0

Share this post


Link to post
Share on other sites

from my limited knowledge of C++, i think this is a problem with using a 32bit library on a 64bit one.

That is correct.

 

You either need to compile a 64-bit version of glew, or compile the glew source files directly into your program.

3

Share this post


Link to post
Share on other sites

I can't find a way to compile 64 bit of glew. I searched for it and there is someone that said that it is fixed in 1.7. I downloaded 1.9 and did a make install and still not working =/

 

i tried to define GLEW_STATIC or something but still no difference >.<

0

Share this post


Link to post
Share on other sites

What version of OS X are you running? 10.6 and above ought to default to compiling 64-bit executables.

 

I just downloaded and build glew, and it works fine. Try running:

file lib/libGLEW.dylib

It should say something like:

lib/libGLEW.dylib: Mach-O 64-bit dynamically linked shared library x86_64
0

Share this post


Link to post
Share on other sites

Sorry, you need to run the file command on the libGLEW.dylib in the glew source directory (the one the makefile built).

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0