DLL paths...

Started by
2 comments, last by MaulingMonkey 21 years, 1 month ago
I''m doing programming at BCC computer lab (Bellevue Community Colledge...Washigton...yeah...). I''m faced with a dilema: they don''t want to install glut. Now, we all get 100 megs on H:, so what I''ve been doing is linking the .lib file from there (as well as including the .h file). The only remaining problem is the glut32.dll. Now, I can copy it into the same folder as every program I''m working on...but that''s rather wastefull, no? And no, I can not place it into the system directory...tried allready . So what I''m wondering is: how can I make the program find glut32.dll when it''s in h:\glut\glut32.dll? some sort of function or VC++ .Net thing? Help much appreciated...thanks!
Advertisement
When trying to load a dll, the system will eventually look in all the directories specified in the PATH environment variable. So if you change the PATH variable before starting your program it should load the dll.
What I really wanted was an in-program thing so I don''t have to navigate the console and manually set path or anything...

I found a soulution soon after I posted this (figures):

Right clicking on the project,
goto properties,
add to the ''Delay Loaded DLLs'' field ''glut32.dll''

first function in main (or at least first function before any glut api calls):

LoadLibrary("H:\\GLUT\\GLUT32.DLL");

note: must include windows.h

thanks for the suggestion though .
Windows will also look for the DLL in the same folder as the .exe file... so just put the DLL next to the .exe!

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement