关于用OpenGL绘制三维图的问题 以下代码为显示一立方体#include #include #include #include void myinit(void);void CALLBACK myreshape(GLsizei w,GLsizei h);void CALLBACK display(void);void myinint(void){\x05glClearColor(0.0,0.0,0.0,0.

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 03:28:54

关于用OpenGL绘制三维图的问题 以下代码为显示一立方体#include #include #include #include void myinit(void);void CALLBACK myreshape(GLsizei w,GLsizei h);void CALLBACK display(void);void myinint(void){\x05glClearColor(0.0,0.0,0.0,0.
关于用OpenGL绘制三维图的问题 以下代码为显示一立方体
#include
#include
#include
#include
void myinit(void);
void CALLBACK myreshape(GLsizei w,GLsizei h);
void CALLBACK display(void);
void myinint(void)
{
\x05glClearColor(0.0,0.0,0.0,0.0);
}
void CALLBACK display(void)
{
\x05glClear(GL_COLOR_BUFFER_BIT);
\x05glColor4f(0.2,0.6,1.0,1.0);
\x05glRotatef(60.0,1.0,1.0,1.0);
\x05auxWireCube(1.0);
\x05glFlush();
}
void CALLBACK myreshape(GLsizei w,GLsizei h)
{
\x05glViewport(0,0,w,h);
}
void main(void)
{
\x05auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
\x05auxInitPosition(0,0,400,400);
\x05auxInitWindow("sample");
\x05myinit();
\x05auxReshapeFunc(myreshape);
\x05auxMainLoop(display);
}
有一以下错误23.obj :error LNK2001:unresolved external symbol "void __cdecl myinit(void)" myinit@@YAXXZ)
Debug/asd.exe :fatal error LNK1120:1 unresolved externals
执行 link.exe 时出错.

关于用OpenGL绘制三维图的问题 以下代码为显示一立方体#include #include #include #include void myinit(void);void CALLBACK myreshape(GLsizei w,GLsizei h);void CALLBACK display(void);void myinint(void){\x05glClearColor(0.0,0.0,0.0,0.
void myinit(void);
void myinint(void)
声明和定义的名称不一样
{
glClearColor(0.0,0.0,0.0,0.0);
}