希望大家帮帮忙啊下面这个有关问题是在VC++ 6.0下编写的OpenGL函数。多谢
希望大家帮帮忙啊,下面这个问题是在VC++ 6.0下编写的OpenGL函数。谢谢。
#include <iostream.h>
#include <windows.h>
//#include <stdio.h>
#include <conio.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
void main(void)
{
auxInitDisplayMode(AUX_SINGLE| AUX_RGBA);
auxInitPosition(0,0,500,500);
//auxInitWindow( "simple ");
glClearColor(0.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
//glColor3f(1.0,0.0,0.0);
//glRectf(-0.5,-0.5,0.5,0.5);
glFlush();
//_sleep(1000);
cprintf( "please any key to close the window\n ");
getch();
}
此程序能通过编译,但在执行时出错了,具体情况如下:
Linking...
d.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
d.obj : error LNK2001: unresolved external symbol __imp__glClear@4
d.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
d.obj : error LNK2001: unresolved external symbol _auxInitPosition@16
d.obj : error LNK2001: unresolved external symbol _auxInitDisplayMode@4
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/sh.exe : fatal error LNK1120: 6 unresolved externals
执行 link.exe 时出错.
sh.exe - 1 error(s), 0 warning(s)
------解决方案--------------------
你把相关的文件都连接到工程里了吗?
#include <iostream.h>
#include <windows.h>
//#include <stdio.h>
#include <conio.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
void main(void)
{
auxInitDisplayMode(AUX_SINGLE| AUX_RGBA);
auxInitPosition(0,0,500,500);
//auxInitWindow( "simple ");
glClearColor(0.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT);
//glColor3f(1.0,0.0,0.0);
//glRectf(-0.5,-0.5,0.5,0.5);
glFlush();
//_sleep(1000);
cprintf( "please any key to close the window\n ");
getch();
}
此程序能通过编译,但在执行时出错了,具体情况如下:
Linking...
d.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
d.obj : error LNK2001: unresolved external symbol __imp__glClear@4
d.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
d.obj : error LNK2001: unresolved external symbol _auxInitPosition@16
d.obj : error LNK2001: unresolved external symbol _auxInitDisplayMode@4
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/sh.exe : fatal error LNK1120: 6 unresolved externals
执行 link.exe 时出错.
sh.exe - 1 error(s), 0 warning(s)
------解决方案--------------------
你把相关的文件都连接到工程里了吗?