将过剩链接到Qt [英] Linking glut to Qt
问题描述
我想将OpenGL与过剩的Qt结合使用. 我正在使用Windows.我的Qt版本是4.7.4,32位.
I want to combine OpenGL with glut to Qt. I'm using Windows. My version of Qt is 4.7.4, 32 bit.
我遵循了该教程:
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:
对glutInit_ATEXIT_HACK的未定义引用
undefined reference to glutInit_ATEXIT_HACK
以及更多未定义的功能参考.
and more undefined references to glutfunctions.
我将glut库和标头复制到了MinGW文件夹中的相应文件夹中. 但是我不确定这是否是正确的文件夹.
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.
推荐答案
MinGW:
将glut.h复制到%dir%\ MinGW \ include \ GL
Copy glut.h to %dir%\MinGW\include\GL
将glut32.lib复制到%dir%\ MinGW \ lib
Copy glut32.lib to %dir%\MinGW\lib
将glut32.dll复制到 C:\ windows \ system32
Copy glut32.dll to C:\windows\system32
将%dir%\ MinGW \ bin 添加到系统的环境变量中.
Add %dir%\MinGW\bin to the system's environmental variables.
Visual Studio:
导航到
%dir%\ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 14.12.25827 \
将 .h 文件放置在... \ include \ GL
Place the .h files in ...\include\GL
将 .lib 文件放置在... \ lib
Place the .lib files in ...\lib
重新启动Visual Studio.
Restart Visual Studio.
这篇关于将过剩链接到Qt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!