View Full Version : Problems with MSVC 7 and OpenGL

03-08-2003, 11:10 PM
Hi All,

I am having some problems compiling OpengGL programs with MSVC 7.

I have installed the components in the appropriate directories - however the compiler fails to compile with these following errors (and it repeats for every function definition in GL.h).

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\gl\GL.h(1152): error C2144: syntax error : 'void' should be preceded by ';'

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\gl\GL.h(1152): error C2501: 'WINGDIAPI' : missing storage-class or type specifiers

I have checked and double checked my settings and cannot work out what the problem is. Anyone got any ideas?

03-08-2003, 11:18 PM
Okay - discovered the problem. The libraries weren't linked. I fixed this using the pragma directive, but it leaves me wondering how the hell you link a library using MSVC 7. Anyone know? The help files are suitably cryptic.

03-08-2003, 11:33 PM
Do you mean, how do you link it in the project settings? If so, go to class view, right click on the project, choose properties which will bring up project settings. Go to input under linker and add your libraries to additional dependencies.

Personally, I actually prefer using #pragma comment. I hate having to search through the project settings because I always forget where I should be looking.

03-08-2003, 11:35 PM
Thanks - yes, that is exactly what I meant. I have had a bit of trouble getting used to MSVC 7 since I had used 6.0 for so long.

Doh! Really simple now that I see that.


03-08-2003, 11:56 PM
I just switched early January. Took me a while to find it in the documentation back then! But, once you get used to it and the class wizard, and a few other things which seem to be less user friendly, its really not that bad. Glad I could pass the info along.