Jump to content

  • Log In with Google      Sign In   
  • Create Account


C++ Opengl on Mac OSX


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 ZwodahS   Members   -  Reputation: 461

Like
0Likes
Like

Posted 19 March 2013 - 05:18 AM

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

Also, check out my first game on play store =D https://play.google.com/store/apps/details?id=com.on.msq


Sponsor:

#2 swiftcoder   Senior Moderators   -  Reputation: 9663

Like
3Likes
Like

Posted 19 March 2013 - 09:30 AM

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 - Software Engineer @Amazon - [swiftcoding]


#3 ZwodahS   Members   -  Reputation: 461

Like
0Likes
Like

Posted 19 March 2013 - 12:39 PM

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

Also, check out my first game on play store =D https://play.google.com/store/apps/details?id=com.on.msq


#4 swiftcoder   Senior Moderators   -  Reputation: 9663

Like
0Likes
Like

Posted 19 March 2013 - 01:10 PM

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 - Software Engineer @Amazon - [swiftcoding]


#5 ZwodahS   Members   -  Reputation: 461

Like
0Likes
Like

Posted 19 March 2013 - 10:32 PM

nope. it isn't there.

 

i am on mac os 10.7


Check out my blog at zwodahs.github.io

Also, check out my first game on play store =D https://play.google.com/store/apps/details?id=com.on.msq


#6 swiftcoder   Senior Moderators   -  Reputation: 9663

Like
0Likes
Like

Posted 20 March 2013 - 06:41 AM

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


Tristam MacDonald - Software Engineer @Amazon - [swiftcoding]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS