Jump to content
  • Advertisement
Sign in to follow this  
iamspecial

opengl doubt

This topic is 3704 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

while using opengl in my c++ program , i had to link these two: -lopengl32 and -lglu32 can anyone explain what these does (i know these are dll but actually cant understand what are they i searched on google too but cant find understandable data please help

Share this post


Link to post
Share on other sites
Advertisement
The first one is OpenGL. Contains function definitions for funtions that start with gl*

The second one is the OpenGL utility library. Contains function definitions that begin with glu*

Share this post


Link to post
Share on other sites
-lopengl32 tells your linker to link your program to the opengl32 library, which is what the OpenGL library is called on Windows. Glu32 is the GLU library, where all the functions named gluSomething live.

Share this post


Link to post
Share on other sites
They're not DLL's, they're import libraries. With C/C++, at compilation time you can link to already-compiled code that comes in the form of a static library. Static libraries, which have the extension .a for gcc(MinGW) and .lib for MSVC, is just a bunch of code that's compiled and dumped to a file. The linker handles setting up the links between your code and the already-compiled code by resolving references to functions and global variables.

DLL's are similar to static libraries in that they also contain precompiled code, but you use them a little differently. Your code is not linked to functions and variables at link time, instead the links are established dynamically at runtime. This linking can happen manually through calls to system functions (explicit linking), or automatically through an import library (implicit linking). When you use an import library, the OS loads the DLL and links up everything for you. This is what's happening with your program: you're statically linking to the import libraries, which means when your program is loaded the OS links your app to the appropriate DLL's.

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!