Question

In short, my program using GLEW and compiled with VS2013 crashes when calling an OpenGL function.

Here's what I did:

Downloaded latest version of GLEW from their website.

Created an empty project in VS 2013

Added glew32s.lib; opengl32.lib; glu32.lib to linker input;

Added main.cpp with the following code (note that I did define GLEW_STATIC)

#include <windows.h>
#define GLEW_STATIC
#include <GL/glew.h>

int main() {
    GLuint s = glCreateShader(GL_VERTEX_SHADER);
    return 0;
}

It builds with the following linker warnings:

1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>glew32s.lib(glew.obj) : warning LNK4099: PDB 'vc100.pdb' was not found with 'glew32s.lib(glew.obj)' or at 'D:\javadyan\Code\tinygamelib_demo\Project1\Debug\vc100.pdb'; linking object as if no debug info

When I run the program it crashes as soon as it hits the glCreateShader call.

Such problems didn't happen in VS2012

Has anyone tried to use GLEW with VS2013? Did you run into something similar and how did you resolve it?

Was it helpful?

Solution

It seems like a problem of C run time mixed version.
1. When you were building your dll with VS2012, which Platform Toolset were you using? Can you use this same version of Platform Toolset with VS2013?
2. Also it may be worth checking the Runtime Library (debug/release, static/dynamic) and comparing their values between your VS2012 and VS2013 projects.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top