Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Help solving a error in openGL

Tags:

macos

opengl

I am making a group work in openGL, and when i try to open the file that my partner gave me i have this error:

-------------- Build: Debug in CG ---------------

Linking console executable: bin/Debug/CG ld: library not found for -lGL collect2: ld returned 1 exit status Process terminated with status 1 (0 minutes, 0 seconds) 0 errors, 0 warnings

I've seen the same code working in his computer. Is it cause he is working in Windows? and i am working in MacOSX? I am using CodeBlocks IDE.

Can anyone help me solving this?

like image 659
Peiska Avatar asked Dec 23 '22 02:12

Peiska


2 Answers

The OpenGL library is actually a Framework on MacOSX.

It should link correctly if you replace -lGL by -framework OpenGL.

like image 123
jweyrich Avatar answered Jan 22 '23 01:01

jweyrich


Try something like the below, as jweyrich said, OpenGL is a framework in Mac OS X:

gcc -framework OpenGL -framework GLUT -o test test.c 
like image 31
Sayan Avatar answered Jan 22 '23 00:01

Sayan