PDA

View Full Version : Installation, IDEs and a very newbie student



JdeAses
09-18-2016, 03:38 PM
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 " :( :(

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

Thanks :D

john_connor
09-18-2016, 04:01 PM
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 ..
https://www.youtube.com/watch?v=CBNoa3ZxUq4
https://www.youtube.com/watch?v=DxNlRMboBuI&list=PLEETnX-uPtBXT9T-hD0Bj31DSnwio-ywh&index=2

GClements
09-18-2016, 04:30 PM
the IDE (codeblocks) send me a message :
"undefined reference to gluLookAt "
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.


you essentially need 2 different libraries:
-- 1 to be able to create a window (which has nothing todo with opengl, example: GLFW)

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.


you essentially need 2 different libraries:
-- and 1 to make opengl functionality available in your application (example: GLEW)

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.

Silence
09-18-2016, 11:32 PM
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 (http://www.mesa3d.org/download.html) provides an implementation of glu.

This tutorial (http://wiki.codeblocks.org/index.php/Using_FreeGlut_with_Code::Blocks) seems to explain in detail how to use glut under your IDE.

JdeAses
09-19-2016, 04:57 PM
Thank you guys, I typed on Codeblocks -lglu32 and the code works :D

Now, another advice about beggining in OpenGL?

Carmine
09-19-2016, 06:45 PM
Codeblocks provides a sample opengl project. That's how I got started. It was very easy.

Silence
09-19-2016, 11:32 PM
I suggest this tutorial (http://www.opengl-tutorial.org/) in order to begin with modern OpenGL. It might not be the best, but it covers the main functionalities.

Sonar Systems
09-23-2016, 01:56 PM
We have created a Modern OpenGL tutorial series https://www.youtube.com/playlist?list=PLRtjMdoYXLf6zUMDJVRZYV-6g6n62vet8