Linking glut to Qt

最后都变了- 提交于 2019-12-02 11:37:20

问题


I want to combine OpenGL with glut to Qt. I'm using Windows. My version of Qt is 4.7.4, 32 bit.

I followed the tutorial:

http://www.youtube.com/watch?v=1nzHSkY4K18

I also checked some other questions of people but they didn't gave me an answer.

The part before including glut works fine. But when I try to include glut it doesn't work. The errors are:

undefined reference to glutInit_ATEXIT_HACK

and more undefined references to glutfunctions.

I copied the glut-libraries and headers to the appropriate folders in the MinGW folder. But I wasn't sure if this was the right folder.


回答1:


MinGW:

Copy glut.h to %dir%\MinGW\include\GL

Copy glut32.lib to %dir%\MinGW\lib

Copy glut32.dll to C:\windows\system32

Add %dir%\MinGW\bin to the system's environmental variables.

Visual Studio:

Navigate to

%dir% \Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\

Place the .h files in ...\include\GL

Place the .lib files in ...\lib

Restart Visual Studio.



来源:https://stackoverflow.com/questions/14882136/linking-glut-to-qt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!