tags:

views:

57

answers:

3

Hi, 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?

A: 

Check that you have the actual library, and that -lGL is the correct flag. The name of the library may be different on your system.

mathepic
A: 

The OpenGL library is actually a Framework on MacOSX.

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

jweyrich
Now I am working in Xcode, and I've imported the framework OpenGL, and i have the g++ 4.1 version but I still have error:Command /Developer/usr/bin/g++-4.0 failed with exit code 1
There should be a previous error message.
jweyrich
There is this error message:duplicate symbol _main in /Users/leonor/Desktop/CG2010/Proj/build/Proj.build/Debug/Proj.build/Objects-normal/i386/Tp.o and /Users/leonor/Desktop/CG2010/Proj/build/Proj.build/Debug/Proj.build/Objects-normal/i386/main.oIt says that is something about the debug configuration.do you have any idea how to solve it?
You have 2 main functions in your code/project. You should have only 1.
jweyrich
A: 

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 
Sayan