C++ Opengl on Mac OSX

Started by
4 comments, last by swiftcoder 11 years, 1 month ago

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 ?

Check out my blog at zwodahs.github.io and zwodahs.itch.io/

Advertisement

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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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 >.<

Check out my blog at zwodahs.github.io and zwodahs.itch.io/

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

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

nope. it isn't there.

i am on mac os 10.7

Check out my blog at zwodahs.github.io and zwodahs.itch.io/

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

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement