
关于用OpenGL绘制三维图的问题 以下代码为显示一立方体
#include<windows.h>#include<gl/gl.h>#include<gl/glu.h>#include<gl/glaux.h>voidmyinit(...
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
void myinit(void);
void CALLBACK myreshape(GLsizei w,GLsizei h);
void CALLBACK display(void);
void myinint(void)
{
glClearColor(0.0,0.0,0.0,0.0);
}
void CALLBACK display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor4f(0.2,0.6,1.0,1.0);
glRotatef(60.0,1.0,1.0,1.0);
auxWireCube(1.0);
glFlush();
}
void CALLBACK myreshape(GLsizei w,GLsizei h)
{
glViewport(0,0,w,h);
}
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,400,400);
auxInitWindow("sample");
myinit();
auxReshapeFunc(myreshape);
auxMainLoop(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 时出错. 展开
#include <gl/gl.h>
#include <gl/glu.h>
#include <gl/glaux.h>
void myinit(void);
void CALLBACK myreshape(GLsizei w,GLsizei h);
void CALLBACK display(void);
void myinint(void)
{
glClearColor(0.0,0.0,0.0,0.0);
}
void CALLBACK display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor4f(0.2,0.6,1.0,1.0);
glRotatef(60.0,1.0,1.0,1.0);
auxWireCube(1.0);
glFlush();
}
void CALLBACK myreshape(GLsizei w,GLsizei h)
{
glViewport(0,0,w,h);
}
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
auxInitPosition(0,0,400,400);
auxInitWindow("sample");
myinit();
auxReshapeFunc(myreshape);
auxMainLoop(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 时出错. 展开
1个回答
展开全部
void myinit(void);
void myinint(void)
声明和定义的名称不一样
{
glClearColor(0.0,0.0,0.0,0.0);
}
void myinint(void)
声明和定义的名称不一样
{
glClearColor(0.0,0.0,0.0,0.0);
}

2024-08-07 广告
作为东莞市大凡光学科技有限公司的一员,我们深知Matlab圆点标定板在相机标定中的重要性。该标定板通过均匀分布的圆点,帮助精确计算相机参数,优化成像效果。Matlab强大的编程功能,使得我们能够灵活设计标定板,调整圆点大小、数量和分布,以满...
点击进入详情页
本回答由东莞大凡提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询