EDN Admin
Well-known member
i have installed VS 2008,i have copied opengl32.lib,glu32.lib,glut32.lib to library folder, and header files to include folder.
now i typed the following code which just displays a window-----
**************************************************************************************************************
#include<GL/glut.h><br/>
void display(void)<br/>
{<br/>
glClear(GL_COLOR_BUFFER_BIT);<br/>
glLoadIdentity();<br/>
glFlush();<br/>
}<br/>
<br/>
void main(int argc,char **argv)<br/>
{<br/>
glutInit(&argc,argv);<br/>
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);<br/>
glutInitWindowSize(500,500);<br/>
glutCreateWindow("3D gasket");<br/>
glutDisplayFunc(display);<br/>
glClearColor(1.0,1.0,1.0,1.0);<br/>
glutMainLoop();<br/>
}
****************************************************************************************************
but i am getting the following erors-----
1>------ Build started: Project: vs, Configuration: Debug Win32 ------<br/>
1>Linking...<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glFlush referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glLoadIdentity referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glClear referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutMainLoop referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glClearColor referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutDisplayFunc referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutCreateWindow referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInitWindowSize referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInitDisplayMode referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInit referenced in function _main<br/>
1>Drogram FilesMicrosoft Visual Studio 9.0projectsvsDebugvs.exe : fatal error LNK1120: 10 unresolved externals<br/>
1>Build log was saved at "file://drogram FilesMicrosoft Visual Studio 9.0projectsvsvsDebugBuildLog.htm"<br/>
1>vs - 11 error(s), 0 warning(s)<br/>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========<br/>
**********************************************************************************************************************
now,i dont know what is causing these problems,can anyone explain me in detail as i am new to this subject,i.e.,visual studio and opengl.
also i have added these files in <span style="font-weight:bold project
<span style="font-weight:bold properties->Linker->Input->Additional dependencies:
<span style="font-weight:bold Opengl32.lib glu32.lib glut32.lib
do i have to use quotes to add them??like this--"Opengl32.lib" "glu32.lib" "glut32.lib"
(also i dont know how to link with the libraries)
thank you in advance..
<br/>
View the full article
now i typed the following code which just displays a window-----
**************************************************************************************************************
#include<GL/glut.h><br/>
void display(void)<br/>
{<br/>
glClear(GL_COLOR_BUFFER_BIT);<br/>
glLoadIdentity();<br/>
glFlush();<br/>
}<br/>
<br/>
void main(int argc,char **argv)<br/>
{<br/>
glutInit(&argc,argv);<br/>
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);<br/>
glutInitWindowSize(500,500);<br/>
glutCreateWindow("3D gasket");<br/>
glutDisplayFunc(display);<br/>
glClearColor(1.0,1.0,1.0,1.0);<br/>
glutMainLoop();<br/>
}
****************************************************************************************************
but i am getting the following erors-----
1>------ Build started: Project: vs, Configuration: Debug Win32 ------<br/>
1>Linking...<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glFlush referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glLoadIdentity referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glClear referenced in function "void __cdecl display(void)" (?display@@YAXXZ)<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutMainLoop referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glClearColor referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutDisplayFunc referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutCreateWindow referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInitWindowSize referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInitDisplayMode referenced in function _main<br/>
1>pr1.obj : error LNK2019: unresolved external symbol _glutInit referenced in function _main<br/>
1>Drogram FilesMicrosoft Visual Studio 9.0projectsvsDebugvs.exe : fatal error LNK1120: 10 unresolved externals<br/>
1>Build log was saved at "file://drogram FilesMicrosoft Visual Studio 9.0projectsvsvsDebugBuildLog.htm"<br/>
1>vs - 11 error(s), 0 warning(s)<br/>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========<br/>
**********************************************************************************************************************
now,i dont know what is causing these problems,can anyone explain me in detail as i am new to this subject,i.e.,visual studio and opengl.
also i have added these files in <span style="font-weight:bold project
<span style="font-weight:bold properties->Linker->Input->Additional dependencies:
<span style="font-weight:bold Opengl32.lib glu32.lib glut32.lib
do i have to use quotes to add them??like this--"Opengl32.lib" "glu32.lib" "glut32.lib"
(also i dont know how to link with the libraries)
thank you in advance..
<br/>
View the full article