无法打开文件“freeglut.lib”解决方法:

资源:

链接:https://pan.baidu.com/s/1eSctT5K 密码:174s

VS2010问题:

无法打开文件“freeglut.lib”解决方法:

(1)下载freeglut-2.8.1.tar.gz压缩包并解压。

(2)将freeglut-2.8.1freeglut-2.8.1includeGL文件夹下的freeglut.h、freeglut_ext.h、freeglut_std.h、glut.h文件复制到C:Program FilesMicrosoft SDKsWindowsv7.0AIncludegl文件夹下。(初次配置OpenGL环境后,C:Program FilesMicrosoft SDKsWindowsv7.0AIncludegl文件夹下会有一个glut.h文件,将它改个名字屏蔽掉,防止覆盖,例如“glut.h-”)

(3)将freeglut-2.8.1freeglut-2.8.1libx86文件夹下的freeglut.dll文件复制到C:WindowsSystem32文件夹下,如果是64位,就放在SysWOW64下,要是不知道就直接都放。

(4)将freeglut-2.8.1freeglut-2.8.1libx86文件夹下的freeglut.lib、freeglut_static.lib文件复制到C:Program FilesMicrosoft SDKsWindowsv7.0ALib文件夹下。

参考链接:(可以自己下载freegult.dil)

http://www.downcc.com/file/300338.html

测试程序:

 1 // Demo2.cpp : 定义控制台应用程序的入口点。
 2 //
 3 
 4 #include "stdafx.h"
 5 #include <GL/freeglut.h>
 6 #include <GL/glut.h>
 7 
 8 void display(){
 9     
10     glClear(GL_COLOR_BUFFER_BIT);
11     glPointSize(15.0);
12     glBegin(GL_POINTS);
13     glColor3f(0.0,0.0,0.0);
14     glVertex2f(-0.6,-0.6);
15     glColor3f(1.0,0.0,0.0);
16     glVertex2f(-0.6,0.6);
17     glColor3f(0.0,0.0,1.0);
18     glVertex2f(0.6,0.6);
19     glColor3f(0.0,1.0,0.0);
20     glVertex2f(0.6,-0.6);
21     glEnd();
22     glFlush();
23 }
24 
25 int main(int argc, char** argv)
26 {
27     glutInit(&argc,argv);
28     glutCreateWindow("Points");
29     glutDisplayFunc(display);
30     glClearColor(1.0,1.0,1.0,0.0);
31     glutMainLoop();
32 }

结果;

无法打开文件“freeglut.lib”解决方法:

VC6.0问题:

无法打开文件“freeglut.lib”解决方法:

(1)用上面的链接,下载freeglut-2.8.1.tar.gz压缩包并解压。

(2)将freeglut-2.8.1freeglut-2.8.1includeGL文件夹下的freeglut.h、freeglut_ext.h、freeglut_std.h、glut.h文件复制到D:Program Files (x86)Microsoft Visual StudioVC98IncludeGL(VC6.0的安装目录)文件夹下。(初次配置OpenGL环境后。

(3)如果上面已经将freeglut-2.8.1freeglut-2.8.1libx86文件夹下的freeglut.dll文件复制到了C:WindowsSystem32文件夹下,如果是64位,就放在SysWOW64下,就不需要进行这一步了。

(4)将freeglut-2.8.1freeglut-2.8.1libx86文件夹下的freeglut.lib文件复制到D:Program Files (x86)Microsoft Visual StudioVC98Lib文件夹下。

测试程序如下:

#include <GL/glut.h>


void display(){
    
    glClear(GL_COLOR_BUFFER_BIT);
    glPointSize(15.0);
    glBegin(GL_POINTS);
    glColor3f(0.0,0.0,0.0);
    glVertex2f(-0.6,-0.6);
    glColor3f(1.0,0.0,0.0);
    glVertex2f(-0.6,0.6);
    glColor3f(0.0,0.0,1.0);
    glVertex2f(0.6,0.6);
    glColor3f(0.0,1.0,0.0);
    glVertex2f(0.6,-0.6);
    glEnd();
    glFlush();
}

int main(int argc, char** argv)
{
    glutInit(&argc,argv);
    glutCreateWindow("Points");
    glutDisplayFunc(display);
    glClearColor(1.0,1.0,1.0,0.0);
    glutMainLoop();
}

运行结果:

无法打开文件“freeglut.lib”解决方法: