Problems with MSVC 7 and OpenGL

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?

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.

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.

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.

Cheers!

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.