problemas con opengl y .net
Publicado por juan antonio vicente pastor (1 intervención) el 09/11/2008 18:30:38
hola, tengo un problema en lo mas basico de opengl, el caso es que estoy realizando la practica de un curso y me da unos errores que nadie sabe responder ni subsanar, este es el codigo:
#include "stdafx.h"
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_MODELVIEW);
gluLookAt(3, 2, 3, 0, 0, 0, 0, 1, 0);
}
void redraw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(1,-1,-1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(1,-1,-1);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,-1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(1, 0, 0);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(-1,-1,-1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(-1,-1,1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,1);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(-1,-1,-1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glColor3f(0.5, 0.0, 1.0);
glVertex3f(1,-1,-1);
glEnd();
glutSwapBuffers();
}
void reshape(int anchura, int altura)
{
glViewport(0,0, (GLsizei) anchura, (GLsizei) altura);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(35, (anchura/altura), 0.1, 10000);
glMatrixMode(GL_MODELVIEW);
}
void keyboard(unsigned char tecla , int x, int y)
{
if (tecla== 27) exit(0);
}
int main(int argc, CHAR* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(320, 240);
glutCreateWindow("opengl1_3");
init();
glutKeyboardFunc(keyboard);
glutDisplayFunc(redraw);
glutReshapeFunc(reshape);
glutMainLoop();
}
y estos los mensajes de error que me suegen a la hora de generar:
1>opengl1_3.obj : error LNK2019: símbolo externo _gluLookAt sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glMatrixMode sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glShadeModel sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glEnable sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glClearColor sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glEnd sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glVertex3f sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glColor3f sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glBegin sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glClear sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _gluPerspective sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>opengl1_3.obj : error LNK2019: símbolo externo _glLoadIdentity sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>opengl1_3.obj : error LNK2019: símbolo externo _glViewport sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>C:Documents and Settings atrosMis documentosVisual Studio 2005Projectsopengl1_3Debugopengl1_3.exe : fatal error LNK1120: 13 externos sin resolver
tengo bien las dependencias y los directorios de inclusion adicionales, tanto de librerias como de encabezados, enlazados a las carpetas del psdk de microsoft 6.1, y sigo sin saber por que me salen esos mensajes, ya que parece ser que soy el unico del curso que los tiene. Tambien cabia la posibilidad de que fuera un problema con la grafica, o algun archivo corrupto, pero instalé visual c++ y el psdk en otro ordenador, con otra grafica distinta y me sigue surgiendo el problema, las graficas en cuestion son ati x2300 y ati 9600 pro, en ambos casos bajo windows xp, alguien sabe a que se debe este problema?
el compilador es visualc++ 2005 express editions
#include "stdafx.h"
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdlib.h>
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_MODELVIEW);
gluLookAt(3, 2, 3, 0, 0, 0, 0, 1, 0);
}
void redraw(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(1,-1,-1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(1,0,0);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(1,-1,-1);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,-1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(1, 0, 0);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(-1,-1,-1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(-1,-1,1);
glEnd();
glBegin(GL_POLYGON);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1,-1,1);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(-1,-1,-1);
glColor3f(0.0, 0.0, 1.0);
glVertex3f(1,-1,1);
glColor3f(0.5, 0.0, 1.0);
glVertex3f(1,-1,-1);
glEnd();
glutSwapBuffers();
}
void reshape(int anchura, int altura)
{
glViewport(0,0, (GLsizei) anchura, (GLsizei) altura);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(35, (anchura/altura), 0.1, 10000);
glMatrixMode(GL_MODELVIEW);
}
void keyboard(unsigned char tecla , int x, int y)
{
if (tecla== 27) exit(0);
}
int main(int argc, CHAR* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowSize(320, 240);
glutCreateWindow("opengl1_3");
init();
glutKeyboardFunc(keyboard);
glutDisplayFunc(redraw);
glutReshapeFunc(reshape);
glutMainLoop();
}
y estos los mensajes de error que me suegen a la hora de generar:
1>opengl1_3.obj : error LNK2019: símbolo externo _gluLookAt sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glMatrixMode sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glShadeModel sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glEnable sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glClearColor sin resolver al que se hace referencia en la función "void __cdecl init(void)" (?init@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glEnd sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glVertex3f sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glColor3f sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glBegin sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _glClear sin resolver al que se hace referencia en la función "void __cdecl redraw(void)" (?redraw@@YAXXZ)
1>opengl1_3.obj : error LNK2019: símbolo externo _gluPerspective sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>opengl1_3.obj : error LNK2019: símbolo externo _glLoadIdentity sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>opengl1_3.obj : error LNK2019: símbolo externo _glViewport sin resolver al que se hace referencia en la función "void __cdecl reshape(int,int)" (?reshape@@YAXHH@Z)
1>C:Documents and Settings atrosMis documentosVisual Studio 2005Projectsopengl1_3Debugopengl1_3.exe : fatal error LNK1120: 13 externos sin resolver
tengo bien las dependencias y los directorios de inclusion adicionales, tanto de librerias como de encabezados, enlazados a las carpetas del psdk de microsoft 6.1, y sigo sin saber por que me salen esos mensajes, ya que parece ser que soy el unico del curso que los tiene. Tambien cabia la posibilidad de que fuera un problema con la grafica, o algun archivo corrupto, pero instalé visual c++ y el psdk en otro ordenador, con otra grafica distinta y me sigue surgiendo el problema, las graficas en cuestion son ati x2300 y ati 9600 pro, en ambos casos bajo windows xp, alguien sabe a que se debe este problema?
el compilador es visualc++ 2005 express editions
Valora esta pregunta


0