Jump to content
  • Advertisement
Sign in to follow this  
doyleman

Linker error with OpenGL

This topic is 4589 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
What IDE are you using?

You need to go to the link options and add "opengl32" and maybe "glu32"

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!