Help getting started in Visual Studio 2013

Started by
2 comments, last by HScottH 10 years, 1 month ago

Greetings!

I can't seem to get a modern (GL 3+) project set up properly in Visual Studio 2013. I get unresolved externals on things lik e_glDrawRangeElements.

I am a seasoned C++ programmer, but haven't done it in a few years. I have programmed GL on Windows, but it was GL 1.1.

For now, I have GLFW and have been able to run the GL 1.1 examples. I've added GLEW, and included glext.h and defined GL_GLEXT_PROTOTYPES. I have opengl32.lib, glfw3.lib, glew.lib and glu.lib referenced.

Can anybody help me get this set up properly? I will be forever in your debt :-)

Advertisement

I think you need to #define GLEW_STATIC before #include of glew.h if you're going to use glew.lib instead of the dll.

I have as follows:

* Added glew32.lib

* Added glfw32.lib

* Added opengl32.lib

My inclusions look like this:

#define GLEW_STATIC
#include <glew.h>

//#define GL_GLEXT_PROTOTYPES
//#define GLFW_INCLUDE_GLCOREARB
//
#include <glfw3.h>
//#include <glext.h>

The commented out portions are ones I have tried both with and without, in various combinations.

I continue to get LNK2001: unresolved external symbol ___glewDrawRangeElements

The same for ___glewBufferData, ___glewEnableVertexAttribArray, etc.

It is as if it can't find the .lib file, but I am certain it's in the correct place (/VC/lib).

Fixed!

The issue was this: when using GLEW_STATIC, you need to link glew32s.lib, and not glew32.lib :-)

This topic is closed to new replies.

Advertisement