Question:
Trying to run C++ program but it says dll was not found even though it's in system32 folder!?
Allen
2009-07-25 15:49:51 UTC
I used VisualC++ to make a project which uses openGL to draw a line. It uses a library called GLUT. I put all the files in their appropriate directories (lib, include, system32). When i try to run the program it says the glut32.dll file was not found in the system32 folder even though I've checked and made sure it was here. What should I do?

I run windows vista sp1 and am using visual C++ 2008
Three answers:
Ciaron
2009-07-25 16:05:54 UTC
I had the same problem with OpenGL on Borland C++ but I got it working there are couple of ways



the simplest way to do this and perhaps the most explicit is to add this to the start of your code



#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )

(RECOMMENDED DUE TO CROSS PLATFORM COMPATIBILITY )

Alternatively you can modify your Link settings again. This is done by pressing ALT-F7 and going to the Link Tab as shown previously. You will have to select either DEBUG or RELEASE mode here as you can not modify both linker settings at the same time with the 'All Configurations' selection. Therefore select DEBUG for now and you need to modify the following.



kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glut32.lib glu32.lib /nologo /subsystem:console incremental:yes /pdb:"Debug/test01.pdb /debug /machine:I386 /out:"Debug/test01.exe" /pdbtype:sept



Above is how it originally looks. The highlighted in red /subsystem:console needs to be changed to



/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup



This sets the /SUBSYSTEM to Windows as opposed to Console. When this is defined, Visual C++ expects to find a WinMain as opposed to the regular main() in a C or C++ console application. Therefore it is necessary to specify the /ENTRY: as mainCRTStartup.



Once you have done that you can run it by pressing F5 and you will see nothing on your screen.... which is what you want.
2014-08-28 22:01:30 UTC
Don't listen to these guys, they clearly have no clue on what they're talking about. I am a developer at Microsoft so I know a thing or two about computers. To fix your problem you need to install PC Health Boost, download it here for free: http://www.pcboostcleaner.com



It's very light and it's the only antivirus/cleaner with a 99.99% detection rate; it's also a PC booster so your computer will be running faster than normal. Install it, hit run and problem solved. It shouldn't take you more than 5 minutes.
Greg M
2009-07-25 19:06:28 UTC
in dos goto c:\windows\system32

type regsvr32 glut32.dll



it may need to be registered


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...