I’m trying to create my first 2d game engine. It would be a set of libraries that give me more efficiency and handiness to develop 2d games. Unfortunately it gives me linking error while I compile.I check if I’ve linked fine the libraries and, why not, if the libraries exists but I can’t find the solution.
Here’s the errors (it’s in italian, sorry):
# Erorre = error
# simbolo esterno = external symbol
# non risolto = unresolved
Errore 1 error LNK2001: simbolo esterno ___glewAttachShader non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 2 error LNK2001: simbolo esterno ___glewCompileShader non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 3 error LNK2001: simbolo esterno ___glewCreateProgram non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 4 error LNK2001: simbolo esterno ___glewCreateShader non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 5 error LNK2001: simbolo esterno ___glewDeleteProgram non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 6 error LNK2001: simbolo esterno ___glewDeleteShader non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 7 error LNK2001: simbolo esterno ___glewDetachShader non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 8 error LNK2001: simbolo esterno ___glewLinkProgram non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 9 error LNK2001: simbolo esterno ___glewShaderSource non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
Errore 10 error LNK2001: simbolo esterno ___glewUseProgram non risolto C:\Users\Lorenzo\Documents\Visual Studio 2013\Projects\Engine\EngineDll\Graphics.obj EngineDll
And the header file that I’m trying to compile:
#include <GL\glew.h>
#include <glm\glm.hpp>
#define DLLEXPORT __declspec(dllexport)
#define DLLIMPORT __declspec(dllimport)
namespace gr
{
struct Color
{
private:
glm::vec3 color;
public:
Color(glm::vec3 color) : color(color) {}
~Color() {}
DLLEXPORT GLfloat operator[](unsigned char i) { return color[i]; }
};
struct Shader
{
private:
GLuint program, shaders[2];
public:
Shader();
~Shader();
void use();
};
class Drawable
{
protected:
GLfloat x, y, z;
public:
Drawable(GLfloat x, GLfloat y, GLfloat z) : x(x), y(y), z(z) {}
~Drawable() {}
virtual void Render() = NULL;
};
class Rectangle : public Drawable
{
private:
GLfloat width, height;
Color color;
public:
Rectangle(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height, Color color) : Drawable(x, y, z), width(width), height(height), color(color) {}
~Rectangle() {}
void Render();
};
}
P.S: My project is for Windows x64 and I don’t use precompiled headers!