Trouble linking to system32 folder in visual studio

Started by
7 comments, last by 21st Century Moose 12 years, 5 months ago
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
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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

I answered this question in the OpenGL forums.

http://www.gamedev.net/topic/615138-difficulty-linking-the-system32-folder-in-visual-studio-2010/
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
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.
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?
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.
This is a duplicate post of one in the OpenGL forum: http://www.gamedev.net/topic/615138-difficulty-linking-the-system32-folder-in-visual-studio-2010/
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.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement