Jump to content
  • Advertisement
Sign in to follow this  
Spencer_Holmes

Trouble linking to system32 folder in visual studio

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

Hello. I am a lecturer in computer games development at college level. I am about to teach my students opengl. I have linked visual studio 2010 to the include and lib folders for the opengl .h and .lib needed files but I cannot add the needed files to the system32 folder on the college network because it administrator passworded. The problem is without adding the .dll files to the system32 folder I wont be able t work n opengl with them. I was wondering however, is there someone out there who knows how, in visual studio 2010, I can point it to another folder which isnt administrator passworded and put the files in there to use?

You help would be very much appreciated!

Thank you

Share this post


Link to post
Share on other sites
Advertisement
What needed files are you referring to? There should be no need whatsoever to add any files to a target computer, provided it's had it's display driver installed correctly (and if it hasn't no amount of adding files will make it work).

Adding files to system32 is generally not recommended anyway; if you need any additional DLLs then they should go in the same folder as the program.

Share this post


Link to post
Share on other sites
The .dll files I need access to which are in the system32 folder are: glu32.dll, glut.dll, glut32.dll, opengl32.dll. So do you think if I put the previous four files in the project folder the program will compile and their will be no need to add them to the system32 folder?

Thank you

Share this post


Link to post
Share on other sites
The opengl32.dll and glu32.dll files should already be in the system32 directory on every correctly installed Windows.
The [s]glu and[/s] glut libraries should be added to the project folders, or another folder where your projects can find them.

EDIT: Edited for correctness.

Share this post


Link to post
Share on other sites
Thank you guys for you help. How do I let visual studio 10 know where to look for this other folder. If I put the dll files in the project folder will vs 2010 automatically find them or do I need to link it somehow like I linked the .h and .lib files?

Share this post


Link to post
Share on other sites
The DLLs can be located in the current working directory for the compiled application, or in the same directory as the .exe. See http://msdn.microsoft.com/en-us/library/7d83bc18.aspx for how Windows searches for DLLs. Usually the default working directory will be set to the project folder when run from within Visual Studio (same as where your source files are), and to the same directory as the .exe when double-clicked in Windows.

Share this post


Link to post
Share on other sites
A DLL is quite different from a .lib file. You need the .lib files in a known location (which MSVC needs to be aware of) in order to compile, but this location can be anywhere on the computer (or even on a network drive). DLLs are not accessed at all at compile time; they're for run time. When the program runs it loads the DLLs (which will typically be in one of the locations given in Erik's link).

Which location to put them in is really up to you, but a general rule is that system32 is for DLLs that belong to the operating system. If a DLL doesn't belong to the operating system it shouldn't go there, so put it somewhere else where the program can find it (Erik's link again).

In the past programs had a bad habit of putting their DLLs into system32, with the result that programs often overwrote each other's DLLs (or even OS DLLs) with different versions. Not nice. That's a primary reason why this is strongly discouraged nowadays. It's the kind of thing that a certain type of "power user" (this type I would define as: "someone who has just about enough knowledge for it to be a dangerous thing") still likes to do, but you shouldn't.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!