Alex Rivera | Logout

Glew problems, unresolved externals

Asked 2012-06-16T01:10:22.063
12

I want to start working with OpenGL 3+ and 4 but I'm having problems getting Glew to work. I have tried to include the glew32.lib in the Additional Dependencies and I have moved the library, and .dll into the main folder so there shouldn't be any path problems. The errors I'm getting are:

Error   5   error LNK2019: unresolved external symbol __imp__glewInit referenced in function "void __cdecl init(void)" (?init@@YAXXZ)   C:\Users\Mike\Desktop\Test Folder\ModelLoader through VBO\ModelLoader\main.obj  ModelLoader
Error   4   error LNK2019: unresolved external symbol __imp__glewGetErrorString referenced in function "void __cdecl init(void)" (?init@@YAXXZ) C:\Users\Mike\Desktop\Test Folder\ModelLoader through VBO\ModelLoader\main.obj  ModelLoader
Error   3   error LNK2001: unresolved external symbol __imp____glewGenBuffers   C:\Users\Mike\Desktop\Test Folder\ModelLoader through VBO\ModelLoader\main.obj  ModelLoader
Error   1   error LNK2001: unresolved external symbol __imp____glewBufferData   C:\Users\Mike\Desktop\Test Folder\ModelLoader through VBO\ModelLoader\main.obj  ModelLoader
Error   2   error LNK2001: unresolved external symbol __imp____glewBindBuffer   C:\Users\Mike\Desktop\Test Folder\ModelLoader through VBO\ModelLoader\main.obj  ModelLoader

And here is most of my code:

#define NOMINMAX

#include <vector>
#include <memory>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <Windows.h>
#include <cstdio>
#include <time.h>
#include "GL\glew.h"
#include "glut.h"

#pragma comment(lib, "glew32.lib")
#pragma comment(lib, "opengl32.lib")

using namespace std;

GLsizei screen_width, screen_height;

float camera[3] = {0.0f, 10.0f, -15.0f};

float xPos = 0;
float yPos = 10;
float zPos = -15;
float orbitDegrees = 0;

clock_t sTime;
float fPS;
int fCount;

GLdouble* modelV;
GLdouble* projM;
GLint* vPort;

//Lights settings
GLfloat l
Edit
Report

1 Answer

2

Not sure how it will help you but, you might give a try and statically link your project to a ".a" library. or it's .lib on windows. If there are unresolved symbol it means it tried to link to a library and not really to a dll.

If it was using the dll, it would probably fail at runtime.

answered 2012-06-23T12:50:52.827

Your Answer