OpenGL Errors in Visual Studio 2013

I am trying to change to use Visual Studio 2013 instead of Code Blocks for my IDE. I am trying to run a project I already made and when it tries to build, it gives me numerous random errors in the gl.h file which I didn't even write. I saw others had this same problem and one solution was to add #include <windows.h> so I did that, and it reduced the number of errors. I tried adding it to more places and it continued to reduce the number of errors. Why do I need that in Visual Studio but not in Code Blocks? Is there some way to put that information somewhere once to fix the problem everywhere?
Who doesn't hate when include files don't include dependencies?
Welcome to Visual Studio, where this kind of things shouldn't happen, but they happen anyways.

However, to the point:
You should put it only once, at the beginning of every .cpp file.

As this alone doesn't work, you need to link to the OpenGL library to correctly use it.

Try looking for a tutorial about how to link a library.
It should be opengl32 and you should search (if you prefer searching) in the project's properties, under Linker.

If you still have problems, write which errors you have.
I checked my old project and in the linker options I have -mwindows -lopengl32
I think the -mwindows is what I need, but I don't know what it is in Visual Studio. Any ideas?
Welcome to Visual Studio, where this kind of things shouldn't happen, but they happen anyways.


There's just as many faults to gcc and its libs as there is with VS and its libs. They're just different.
Topic archived. No new replies allowed.