Sign in to follow this  

opengl doubt

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

This topic is 3489 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this