设置opengl和visual studio 2010时出现问题

时间:2011-02-13 00:22:44

标签: visual-studio-2010 opengl

我是opengl和visual studio的初学者。我正在使用VS2010,我在设置opengl时遇到了一些问题。我下载了NVDIA SDK,所以我在include目录下有gl.h和其他头文件。我下载了glut并将glut32.dll放在与我的源文件相同的目录中。如果我把glut32.dll放在system32下,它不起作用。我可以使用资源管理器查看该文件,但对于包括VS2010在内的其他应用程序不可见。我还将lib文件放到正确的Windows SDK文件夹中,并将链接器glut32.lib glu32.lib opengl32.lib添加到我的项目中。我在网上找到了这个代码 http://uowteaminvincible.wordpress.com/2010/06/23/getting-started-with-opengl-and-glut-in-microsoft-visual-studio-2008-in-windows-vista/

它不会给我任何东西,只有一个写窗口(即使我最后还没注释了一些函数)

还有很多错误(但可以编译和运行)

请帮忙。谢谢!

1   IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152    1   
2   IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152    11  
3   IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153    1   
4   IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153    11  
5   IntelliSense: variable "WINGDIAPI" is not a type name   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154    1   
6   IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154    21  
7   IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155    1   
8   IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155    11  
9   IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156    1   
10  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156    11  
11  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157    1   
12  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157    11  
13  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158    1   
14  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158    11  
15  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159    1   
16  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159    11  
17  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160    1   
18  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160    11  
19  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161    1   
20  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161    11  
21  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162    1   
22  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162    11  
23  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163    1   
24  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163    11  
25  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164    1   
26  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164    11  
27  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165    1   
28  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165    11  
29  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166    1   
30  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166    11  
31  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167    1   
32  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167    11  
33  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168    1   
34  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168    11  
35  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169    1   
36  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169    11  
37  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170    1   
38  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170    11  
39  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171    1   
40  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171    11  
41  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172    1   
42  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172    11  
43  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1173    1   
44  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1173    11  
45  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1174    1   
46  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1174    11  
47  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1175    1   
48  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1175    11  
49  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1176    1   
50  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1176    11  
51  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1177    1   
52  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1177    11  
53  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1178    1   
54  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1178    11  
55  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1179    1   
56  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1179    11  
57  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1180    1   
58  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1180    11  
59  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1181    1   
60  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1181    11  
61  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1182    1   
62  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1182    11  
63  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1183    1   
64  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1183    11  
65  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1184    1   
66  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1184    11  
67  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1185    1   
68  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1185    11  
69  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1186    1   
70  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1186    11  
71  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1187    1   
72  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1187    11  
73  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1188    1   
74  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1188    11  
75  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1189    1   
76  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1189    11  
77  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1190    1   
78  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1190    11  
79  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1191    1   
80  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1191    11  
81  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1192    1   
82  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1192    11  
83  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1193    1   
84  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1193    11  
85  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1194    1   
86  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1194    11  
87  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1195    1   
88  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1195    11  
89  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1196    1   
90  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1196    11  
91  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1197    1   
92  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1197    11  
93  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1198    1   
94  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1198    11  
95  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1199    1   
96  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1199    11  
97  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1200    1   
98  IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1200    11  
99  IntelliSense: this declaration has no storage class or type specifier   c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1201    1   
100 IntelliSense: expected a ';'    c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1201    11  

1 个答案:

答案 0 :(得分:6)

在gl.h之前尝试包含windows.h

另请参阅此Can't include <gl/gl.h>