Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Trouble linking to system32 folder in visual studio


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Spencer_Holmes   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 November 2011 - 03:13 PM

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

Ad:

#2 mhagain   Members   -  Reputation: 3801

Like
0Likes
Like

Posted 16 November 2011 - 07:14 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 MarkS   Members   -  Reputation: 570

Like
0Likes
Like

Posted 16 November 2011 - 09:45 PM

I answered this question in the OpenGL forums.

http://www.gamedev.net/topic/615138-difficulty-linking-the-system32-folder-in-visual-studio-2010/

#4 Spencer_Holmes   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 November 2011 - 12:39 PM

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

#5 Erik Rufelt   Members   -  Reputation: 1984

Like
0Likes
Like

Posted 17 November 2011 - 12:41 PM

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

EDIT: Edited for correctness.

#6 Spencer_Holmes   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 November 2011 - 01:02 PM

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?

#7 Erik Rufelt   Members   -  Reputation: 1984

Like
1Likes
Like

Posted 17 November 2011 - 02:18 PM

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.

#8 MarkS   Members   -  Reputation: 570

Like
0Likes
Like

Posted 17 November 2011 - 04:48 PM

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/

#9 mhagain   Members   -  Reputation: 3801

Like
1Likes
Like

Posted 17 November 2011 - 09:11 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS