我一直在尝试在Qt项目中使用freeglut。不幸的是,当我使用像'glutWireSphere‘或'glutWireTorus’这样的过剩函数时,我得到了一个错误:
freeglut错误:调用函数时不首先调用“glutInit”。
当我试图运行一个应用程序时,它会立即退出。我不知道该在哪里叫“谷氨酸”。根据本教程,我安装了freeglut:
https://www.youtube.com/watch?v=M4fm-cHGoYU&index=1&list=LLkYBBRyDu3gfOojsRQOM3JQ发布于 2014-11-01 00:23:28
我已经想明白了。其实很简单。我需要在我的main.cpp中使用'glutInit( & argc,argv )‘,如下所示:
int main(int argc, char *argv[])
{
glutInit( & argc, argv );
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}https://stackoverflow.com/questions/26685010
复制相似问题