Installation, IDEs and a very newbie student

Hi, i’m new in this, and i dont know how start in OpenGL programming, i’ve downloaded freeglut, but, i don’t know if i’ve correctly installed, because, the IDE (codeblocks) send me a message :
"undefined reference to gluLookAt " :frowning: :frowning:

How can i fix it, and at least, how can i install the necessary for start correctly in this world.

Thanks :smiley:

you essentially need 2 different libraries:
– 1 to be able to create a window (which has nothing todo with opengl, example: GLFW)
– and 1 to make opengl functionality available in your application (example: GLEW)

there are many youtube videos that shows step-bystp what to do …

[QUOTE=JdeAses;1283897]the IDE (codeblocks) send me a message :
"undefined reference to gluLookAt "[/QUOTE]
That function is provided by the GLU library, which is commonly used by a lot of legacy OpenGL code. It’s less used with modern OpenGL code as many of the functions (including that one) only work with a compatibility profile context or an older version of OpenGL.

[QUOTE=john_connor;1283898]you essentially need 2 different libraries:
– 1 to be able to create a window (which has nothing todo with opengl, example: GLFW)
[/QUOTE]
It’s not really accurate to say that it’s “nothing to do with OpenGL”. Apart from a window, you also need an OpenGL context.

You don’t actually need a library to do that for you, but doing it yourself is a fair amount of work, requires some fairly specific knowledge, and the code involved is highly platform-specific (so it’s even more work if you want to support multiple platforms). So you’re better off using GLUT, GLFW or SDL if you want a window (possibly a full-screen window) for OpenGL rendering, or a GUI toolkit such as GTK, Qt, or wxWidgets if you want GUI features.

[QUOTE=john_connor;1283898]you essentially need 2 different libraries:
– and 1 to make opengl functionality available in your application (example: GLEW)
[/QUOTE]
GLEW (or GL3W) is very useful if you want to use modern OpenGL on Windows. It isn’t needed if you only need OpenGL 1.1 or are using other platforms. It isn’t strictly necessary on any platform, but if you’re using modern OpenGL on Windows, you’ll need to query a lot of function pointers with wglGetProcAddress() if you aren’t having a library such as GLEW handle it for you.

Also, GLEW can be a bit tricky to use; follow the instructions closely.

You first need to check if glu.lib (or glu32.lib) is available in the library path of your IDE. If so, just add glu or glu32 to your linker, ie:


-lglu32

If you don’t have it, then you’ll probably have to compile it. Mesa provides an implementation of glu.

This tutorial seems to explain in detail how to use glut under your IDE.

Thank you guys, I typed on Codeblocks -lglu32 and the code works :smiley:

Now, another advice about beggining in OpenGL?

Codeblocks provides a sample opengl project. That’s how I got started. It was very easy.

I suggest this tutorial in order to begin with modern OpenGL. It might not be the best, but it covers the main functionalities.

We have created a Modern OpenGL tutorial series https://www.youtube.com/playlist?list=PLRtjMdoYXLf6zUMDJVRZYV-6g6n62vet8