Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [total n00b]QGLWidgets keeps giving LNK2001 error in visual studio 2013??

[total n00b]QGLWidgets keeps giving LNK2001 error in visual studio 2013??

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 785 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RJ_KU
    wrote on last edited by
    #1

    sorry if my question is too noobish ,but really i have tried almost everything, my main point was to get some opengl code running in visual studio and study of "opengl programming guide" , i am trying for 2nd day now, with no luck....

    i have everything set up ,added the include folder , the lib folder also copied the bin folder to the debug folder , i ran an empty QApplication and it worked , now i don't know why this doesn't work

    My main:
    @

    #include"QtWidgets\qapplication.h"
    #include"Screen.h"

    int main(int argc, char* argv[]){
    QApplication app(argc, argv);
    Screen s;
    s.show();
    return app.exec();
    }
    @

    The Screen class header , screen.cpp is empty:
    @
    #pragma once
    #ifndef SCREEN
    #define SCREEN
    #include <QtOpenGL\qglWidget>
    class Screen : public QGLWidget
    {
    public:
    void initializeGL();
    void paintGL();
    };
    #endif
    @

    i just want to show the opengl window , and apparently i cant even do that

    here is a LNK error
    @
    Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QGLWidget::QGLWidget(class QWidget *,class QGLWidget const *,class QFlags<enum Qt::WindowType>)" (_imp??0QGLWidget@@QEAA@PEAVQWidget@@PEBV0@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "public: __cdecl Screen::Screen(void)" (??0Screen@@QEAA@XZ) D:\OpenGL\c++\firstOpen\tmain.obj firstOpen
    @
    it is basically 25 of those!!

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi, welcome to devnet.

      OpenGL support is a separate module in Qt. You need to tell linker where to look for it.
      Add this to your .pro file:
      @
      QT += opengl
      @

      Edit: Oh, and re-run qmake after that.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved