VISUAL STUDIO problem.. please help.
I just did, ..
#include <gl/glut.h>
and in order to use the glut.h header file, I have to put the glut.dll and glut.lib files on the window''s system and system32
folders.... which I did~!!! and I get this error in VISUAL STUDIO .NET ~!!!
The actual code is :
#include <gl/glut.h>
#include <stdlib.h>
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.75, 0.25, 0.0);
glVertex3f(0.75, 0.75, 0.0);
glVertex3f(0.25, 0.75, 0.0);
glEnd();
glFlush();
}
void init(void)
{
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 argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(250,250);
glutInitWindowPosition(100,100);
glutCreateWindow("hello");
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
and error :
"tutorial1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup"
HELP~!!!!!
choesh
choesh
glut.lib does not go into any system folder or anything. This file goes into the VC/lib folder for Visual C++, though this ought to be installed with VC. So it should already be there.
Then you need to link glut.lib to you program in the project settings (Link tab, then append " glut.lib" to the Object/Library moduals line). Now your project should compile just fine.
Another option for linking the glut.lib to your projects though the project settings panel is to add this line to the top of your main file.
#pragma comment(lib, "glut.lib")
This works kind of like an include statement for libraries, ''cept that it is not ANSI Standard, so it only works in VC.
Then you need to link glut.lib to you program in the project settings (Link tab, then append " glut.lib" to the Object/Library moduals line). Now your project should compile just fine.
Another option for linking the glut.lib to your projects though the project settings panel is to add this line to the top of your main file.
#pragma comment(lib, "glut.lib")
This works kind of like an include statement for libraries, ''cept that it is not ANSI Standard, so it only works in VC.
- Go not to the elves for counsel, for they will say both yes and no.
You need to change your application from a "Windows" application to a "Console" application. In the Linker tab on the project settings, down the bottom there''s a "Command-line" section, change the bit which says "/subsystem:window" to "/subsystem:console" and that''ll fix it.
codeka.com - Just click it.
If I had my way, I''d have all of you shot!
codeka.com - Just click it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement