irn.2022
سه شنبه 20 بهمن 1394, 00:09 صبح
مشکل این کد چیه که:
#include<iostream>
#include <stdio.h>
#include <tchar.h>
#include <conio.h>
#include<gl/glut.h>
//using namespace std;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2f(-0.5,-0.5);
glVertex2f(-0.5,0.5);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glEnd();
glFlush();
}
int maine(int argc , char **argv)
{
glutInit(& argc,argv);
glutCreateWindow(" ddddd");
glutDisplayFunc(display);
glutMainLoop();
///getch();
return 0;
}
این ارور میده:
1>------ Build started: Project: 1, Configuration: Debug Win32 ------
1> simple.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\users\saeed\documents\visual studio 2012\Projects\1\Debug\1.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#include<iostream>
#include <stdio.h>
#include <tchar.h>
#include <conio.h>
#include<gl/glut.h>
//using namespace std;
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2f(-0.5,-0.5);
glVertex2f(-0.5,0.5);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glEnd();
glFlush();
}
int maine(int argc , char **argv)
{
glutInit(& argc,argv);
glutCreateWindow(" ddddd");
glutDisplayFunc(display);
glutMainLoop();
///getch();
return 0;
}
این ارور میده:
1>------ Build started: Project: 1, Configuration: Debug Win32 ------
1> simple.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\users\saeed\documents\visual studio 2012\Projects\1\Debug\1.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========