Sign in to follow this  

Getting executables to run on all PCs (glut32.dll missing)

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

Hi guys, I've written some C++ code to render a cube, not very fancy but I'm new to this. It builds and runs on my PC and the exe runs on my friend's PC too (I assume he has glut32.dll). However, the exe doesn't run on the PCs in my university (This applicationhas failed to start because glut32.dll was not found. Re-installing the application may fix this problem). I assume this is because I haven't put glut32.dll in the system32 folder but the problem is, I don't have access to that folder in university. So basically, is there a way that I can get around this problem? Instead of plonking glut.h, glut32.lib and glut32.dll in the usual folders on my pc, can i put them all in my project somehow? Thanks in advance, I hope this question isn't too trivial, I've been googling for some time and haven't really got anywhere.

Share this post


Link to post
Share on other sites
I'm not sure what you mean with that last question, but from the sound of it what you want is to link your executable statically instead of dynamically, which would mean there's no need to copy DLLs along with it to different machines. Basically every method your program uses in glut32.lib would get copied into your executable when you compile it, and the loader wouldn't have to look it up in glut32.dll at run-time. This would make your executable slightly bigger (since the methods need to be somewhere, one way or another) but would make it virtually stand-alone.

I'm pretty sure this can be done with Visual Studio, but as I've never done any Windows development I'm afraid I can't tell you how to do it. Look around for stuff that sounds similar to "static" or "stand-alone" and has to do with the linker :)

Share this post


Link to post
Share on other sites
Thanks, you're correct in thinking that I basically want a stand-alone executable.

I'll have a look at the options in visual studio and google static linking.

I'll update this thread if I get it sorted incase any other newbies are having the same problem.

Share this post


Link to post
Share on other sites
Well, I tried all last night to find a way to create a truly stand alone exe in vc++ but to no avail. I really must be mssing a trick here, I just want a way toc compile my program so that I don't need glut32.dll in the same directory all the time.

Any ideas?

Share this post


Link to post
Share on other sites

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