Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Help getting started in Visual Studio 2013

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 HScottH   Members   

520
Like
0Likes
Like

Posted 22 February 2014 - 01:05 AM

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 :-)



#2 richardurich   Members   

1330
Like
0Likes
Like

Posted 22 February 2014 - 07:09 AM

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.



#3 HScottH   Members   

520
Like
0Likes
Like

Posted 22 February 2014 - 11:30 AM

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).
 



#4 HScottH   Members   

520
Like
2Likes
Like

Posted 22 February 2014 - 12:13 PM

Fixed!

 

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






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.