zoukankan      html  css  js  c++  java
  • VS QT 配置OpenGL

    在visual studio 下编译OpenGL代码出现以下错误,原因是vs没有自带opengl库,需要自己引入

    • 无法解析的外部符号 __imp__glClear@4
    • 无法解析的外部符号 __imp__glClearColor@16
    • 无法解析的外部符号 __imp__glDrawElements@16
    • 无法解析的外部符号 __imp__glEnable@4
    • 无法解析的外部符号 __imp__glFrontFace@4
    • 无法解析的外部符号 __imp__glViewport@16

    解决方法

    去官网下载glut包: 地址 
    解压后放在工程目录下

    @ 包含库

    win32: LIBS += -L$$PWD/opengl/ -lglut
    win32: LIBS += -L$$PWD/opengl/ -lglut32
    INCLUDEPATH += $$PWD/opengl
    DEPENDPATH += $$PWD/opengl

    @包含头文件

    #include "opengl/glut.h"

    @ 把glut.dll glut32.dll拷贝到生成程序的目录下

    浏览了下看到有人建议把库放到vc安装目录下,本人并不建议这样做,作为第三方库有不同的版本,可能由于引入不同版本的库导致莫名其妙的问题

    http://blog.csdn.net/x356982611/article/details/52877834

  • 相关阅读:
    ZOJ3213-Beautiful Meadow
    ZOJ3256-Tour in the Castle
    ZOJ3466-The Hive II
    hdu3377-Plan
    fzu1977-Pandora Adventure
    ural1519-Formula 1
    poj2914-Minimum Cut
    51nod-1220-约数之和
    51nod-1222-最小公倍数计数
    【html】【6】div浮动float
  • 原文地址:https://www.cnblogs.com/findumars/p/5090368.html
Copyright © 2011-2022 走看看