OpenGL and Visual Studio 2010 Problems


I have googled high and low for this but I am unable to find an answer to my specific problem.

I am getting this error when I try and build my program:

error C1083: Cannot open include file: ‘GL/glx.h’: No such file or directory.

My OS is windows 7 (64bit)

A code sample if that helps anyone.

#include <GL/glx.h>

#include "glx/glxext.h"

#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/xf86vmode.h>
#include <X11/keysym.h>
#include <ctime>

GLX is for X Windows. Which is not present on Microsoft Windows. Where did you find this code?

Yup, you’re basically taking a chunk of Linux code (not specifically OpenGL code, this is OS-level stuff - at the level that OpenGL interacts with the OS) and trying to compile it on Windows. No way is that going to work.

OpenGL may well have a reputation for being “easy”, but it’s not that easy I’m afraid; you do need to know a bit about how to build regular apps for your environment first, and you do need to know a bit about how your environment interacts with OpenGL too.

Nehe has some Win32 code

They have about 30 tutorials, all of them way outdated such as using glaux to read a bmp file and using immediate mode, fixed pipeline. But, it is a starting point.

You can also look at CodeSampler for a basic program that creates a window enabled for OpenGL:

Once you’ve that done, have a read here too:

You should be able to relate what’s in the wiki page to what you see in the working code, and get a better understanding of the process from that.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.