Erro de vinculador do Visual Studio 2012 C ++ OpenGL GLFW
Eu estou fazendo um side-scroller 2D em C ++ usando OpenGL no Visual Studio 2010 Express. Eu estou tentando compilar meu código e ele constrói corretamente, mas eu recebo erros de linker para as funções GLFW que estou inicializando na função main (). Aqui está o meu código:
#include <iostream>
#include <ctime>
#include <GL\glfw.h>
#include "Player.h"
void render();
void update();
Player Player1;
//Cross platform sleep implementation
void _sleep(double ms)
{
double st = clock();
if(ms <= 0)
ms = 10;
while(clock() < (ms + st));
}
int main(int argc, char** argv)
{
std::cout <<"Loading Prized Fighter"<< std::endl;
glfwInit(); //Initialize GLFW
//Create GLFW window
if(glfwOpenWindow(800, 600, 5, 6, 5, 0, 8, 0, GLFW_WINDOW) != GL_TRUE)
std::cout << "Error creating window!" << std::endl;
//Set window title
glfwSetWindowTitle("Prized Fighter");
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//Start main game loop
//This calls the functions which update objects and render them to the screen
while(true)
{
update();
render();
glfwSwapBuffers(); //Switch buffers (double rendering)
_sleep(10.0); //Let a bit of CPU time for other processes
}
return 0;
}
/*
- Render function -
Used to draw objects to the screen
*/
void render()
{
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //Color to clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//TODO: Draw stuff here
Player1.draw();
}
/*
- Update function -
Updates objects; states, locations, etc
*/
void update()
{
//TODO: Update objects here
Player1.update();
}
Quando eu compilo, recebo os seguintes erros:
1> ------ Build started: Projeto: Prized Fighter, Configuração: Depurar Win32 ------ 1> main.obj: erro LNK2019: símbolo externo não resolvido _glfwSwapBuffers referenciado em> function _WinMain @ 8
1> main.obj: erro LNK2019: símbolo externo não resolvido _glfwSetWindowTitle referenciado em> function _WinMain @ 8
1> main.obj: erro LNK2019: símbolo externo não resolvido _glfwOpenWindow referenciado em> function _WinMain @ 8
1> main.obj: erro LNK2019: símbolo externo não resolvido _glfwInit referenciado na função> _WinMain @ 8
1> MSVCRTD.lib (crtexew.obj): erro LNK2019: símbolo externo não resolvidoWinMain @ 16> referenciado na função __tmainCRTStartup
1> c: \ users \ brennan \ documentos \ visual studio 2010 \ Projetos \ Prized Fighter \ Debug \ Prized> Fighter.exe: erro fatal LNK1120: 5 externos não resolvidos ========== Build: 0 sucedido, 1 falhou, 0 atualizado, 0 ignorado ==========
O que está errado durante a vinculação - há um erro no código?