Linker error with OpenGL

Started by
8 comments, last by mapster 18 years ago
Okay, I got 152 linker errors on my Open GL project. I typed it all up, compiled it, fixed what bugs I had, and after I did it all, I get linker errors!!! how do I fix em?
Advertisement
What are linker errors?
Man that sucks... So I have to type up the OpenGL window create every time I make a new project?
What IDE are you using?

You need to go to the link options and add "opengl32" and maybe "glu32"
Quote:Original post by doyleman
Man that sucks... So I have to type up the OpenGL window create every time I make a new project?


Are you using SDL? I'm a big fan of it, as it can cut out a lot of work, and it's also compatible with OGL.

Either way, you could also encapsulate your window creation code into a CWindow class.
XBox 360 gamertag: templewulf feel free to add me!
I'm using Dev-C++ (that's a IDE, isnt it? idk)

I have SDL, yes. No idea what to do with it...
Quote:Original post by doyleman
I'm using Dev-C++ (that's a IDE, isnt it? idk)

I have SDL, yes. No idea what to do with it...


I mentioned SDL in response to your complaint about how much code you have to write every time you want to make a window. SDL requires only a line or two of code, and is cross-platform. So, not only does it make development a little easier, it makes porting your code MUCH easier.

If you're using the Win32 API with OpenGL, SDL would replace the WINAPI part of the equation. Try this Google search.

PS: I also mentioned wrapping that functionality into a class. This isn't necessary to make a game, but powerful concepts like that will make you a much better programmer overall.
XBox 360 gamertag: templewulf feel free to add me!
I'm no expert but here is what libraries Nehe has in his OpenGL tutorials;
"opengl32.lib glu32.lib glaux.lib odbc32.lib odbccp32.lib"
On Dev-C++ you go to Project properties -> Parameters and type in the libraries in the linker text box.
Quote:Original post by templewulf
Quote:Original post by doyleman
I'm using Dev-C++ (that's a IDE, isnt it? idk)

I have SDL, yes. No idea what to do with it...


I mentioned SDL in response to your complaint about how much code you have to write every time you want to make a window. SDL requires only a line or two of code, and is cross-platform. So, not only does it make development a little easier, it makes porting your code MUCH easier.

If you're using the Win32 API with OpenGL, SDL would replace the WINAPI part of the equation. Try this Google search.

PS: I also mentioned wrapping that functionality into a class. This isn't necessary to make a game, but powerful concepts like that will make you a much better programmer overall.


I don't recall making a post about how much code it takes to make a window-only how to use images and if nehe was a good tutorial session for GL...

But anyway, I stayed up last night, working from lesson one, COMPLETELY typed it all up, and still linker errors. Looked for the option to add the 'whatever's in my project, didn't find up, threw a fit, and went to sleep.

Thanks for the help anyway.
Then a tip for you, it's what I did when my opengl projects didn't compile, download the source code for the tutorial your working on, then compare every parameter in project prefences/settings.

This topic is closed to new replies.

Advertisement