编译程序找不到freeglut.dll [英] compiled program cannot find freeglut.dll

查看:859
本文介绍了编译程序找不到freeglut.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个网站的新手,而且比较新。
我一直在使用Visual Studio 2010做一些C ++编程,我想进入OpenGL,所以我买了OpenGL Superbible开始。我已经陷入了第二章的简单项目。
经过几个小时的研究,我已经能够下载所有必要的文件,使用freeGLUT和GLtools。我已经确保一切都在正确的地方为程序工作。
现在,它看起来好像一切都已经解决了,除了一个奇怪的问题。

I'm new to this site, and relatively new to programming. I've been doing some C++ programming for a while using Visual Studio 2010, and I wanted to get into OpenGL, so I bought the OpenGL Superbible to get started. I've gotten stuck on the second chapter's "simple" project. After hours of research I've been able to download all the necessary files to use freeGLUT and GLtools. I've made sure that everything is in the right place for the program to work. Now, it appears as though everything has been worked out... except for one odd problem.

我被指示,我需要放置freeglut.dll进入Windows \System32,所以我没有。该项目现在将构建,但是当我去运行它,它告诉我

I was instructed that I needed to place freeglut.dll into Windows\System32, so I did. The project will build now, but when I go to run it, it tells me


程序无法启动,因为freeglut.dll从您的计算机中缺少。尝试
重新安装程序来解决这个问题。

"The program can't start because freeglut.dll is missing from your computer. Try reinstalling the program to fix this problem."

现在,我确定freeglut.dll在Windows \System32中是应该的,所以有什么问题?如何解决?

Now, I am certain that freeglut.dll is in Windows\System32 as it should be, so what's the problem? how do I solve it?

这是本书的原始代码:

#include "../../shared/gltools.h"  //OpenGL toolkit

//////////////////////////////////////////////
//called to draw scene

void RenderScene(void)
{
    // clear the window with current clearing color
    glClear(GL_COLOR_BUFFER_BIT);

 //Flush drawing commands
    glFlush();
}
////////////////////////////////////////////////////////
//set up the rendering state
void SetupRC(void)
{
    glClearColor(0.0f , 0.0f, 1.0f, 1.0f );
}
///////////////////////////////////////////////////////////
//main program entry point
void main(void)
int main(int argc, char* argv[])
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
    glutCreateWindow("Simple");
    glutDisplayFunc(RenderScene);

    SetupRC();
    glutMainLoop();
    return 0;
    }

这是实际编译的代码,但不会运行我从不同的资源获得的所有冲突数据的混乱):

This is the code that actually compiled, but would not run (it's a bit of a mess from all the conflicting data I got from different resources):

 #include <stdio.h>
 #include <stdlib.h>
 #include <windows.h>
 #include <GLTools.h>
 #include <gl/GLUT.h>
 //called to draw scene

 void RenderScene(void)
 {
// clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);

glFlush();
 }

 //set up the rendering state
 void SetupRC(void)
 {
glClearColor(0.0f , 0.0f, 1.0f, 1.0f );
 }

 //void main(void)
 int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow("Simple");
glutDisplayFunc(RenderScene);

SetupRC();
glutMainLoop();
return 0;
}


推荐答案

与您的exe文件相同的文件夹。建议把它放在Windows \System32早于许多较新的Windows安全限制。

Try putting the DLL in the same folder as your exe file. The advice to put it in Windows\System32 predates a lot of newer Windows security restrictions.

这篇关于编译程序找不到freeglut.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆