PDA

View Full Version : i cant run a glut application in win 7



oscar leo
05-28-2010, 09:08 PM
hi i need know why i cant run my application in the Visual C+ express and one project in win32 api and opengl yes run

Error 1 error LNK2019: external symbol __imp____glutInitWithExit@12 unresolved referred to in the function _glutInit_ATEXIT_HACK@8 main.obj

Error 2 error LNK2019: external symbol __imp____glutCreateWindowWithExit@8 unresolved referred to in the function _glutCreateWindow_ATEXIT_HACK@4 main.obj

Error 3 fatal error LNK1120: 2 unresolved externals C:\Users\oscar\Documents\Visual Studio 2008\Projects\miopenglless\Debug\miopenglless.exe

with this code

#pragma once

#include <GL/glut.h>

void Draw()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINES);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glEnd();
glFlush();
}

void Initialize()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}

int main(int iArgc, char** cppArgv)
{
glutInit(&amp;iArgc, cppArgv);
glutInitDisplayMode(GLUT_SINGLE |GLUT_RGB);
glutInitWindowSize(250, 250);
glutInitWindowPosition(200, 200);
glutCreateWindow("Ventana");
Initialize();
glutDisplayFunc(Draw);
glutMainLoop();
return 0;
}