Results 1 to 2 of 2

Thread: QGL in QTcreator 2.5.2

  1. #1
    Join Date
    Nov 2012
    Posts
    18
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QGL in QTcreator 2.5.2

    Hello all,
    I've been trying to get a widget to display graphics using OpenGL 3.1. I've done OpenGL coding before, mainly with freeglut, but I need an easy framework to control variables, and QT's widgets seem perfect. However, I've been having trouble getting OGL 3.0+ to work properly. I've followed this tutorial to the click, but when he builds his project at 5:10, I get a message complaining about an unresolved external symbol in mainwindow.obj:
    Qt Code:
    1. mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall GLWidget::GLWidget(class QObject *)" (??0GLWidget@@QAE@PAVQObject@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)
    To copy to clipboard, switch view to plain text mode 
    with this as the compiling output:
    Qt Code:
    1. 13:27:02: Running steps for project yet_more_ogl...
    2. 13:27:02: Configuration unchanged, skipping qmake step.
    3. 13:27:02: Starting: "C:\Qt\qtcreator-2.5.2\bin\jom.exe"
    4. C:\Qt\qtcreator-2.5.2\bin\jom.exe -f Makefile.Debug
    5. link /LIBPATH:"c:\Qt\4.8.3opensource\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\yet_more_ogl.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\yet_more_ogl.exe @C:\Users\Matt\AppData\Local\Temp\yet_more_ogl.exe.4152.0.jom
    6. mainwindow.obj : error LNK2019: unresolved external symbol "public: __thiscall GLWidget::GLWidget(class QObject *)" (??0GLWidget@@QAE@PAVQObject@@@Z) referenced in function "public: void __thiscall Ui_MainWindow::setupUi(class QMainWindow *)" (?setupUi@Ui_MainWindow@@QAEXPAVQMainWindow@@@Z)
    7. debug\yet_more_ogl.exe : fatal error LNK1120: 1 unresolved externals
    8. jom: C:\Qt\qtcreator-2.5.2\project\yet_more_ogl-build-desktop-Qt_4_8_3_in_PATH__4_8_3opensource__Debug\Makefile.Debug [debug\yet_more_ogl.exe] Error 1120
    9. jom: C:\Qt\qtcreator-2.5.2\project\yet_more_ogl-build-desktop-Qt_4_8_3_in_PATH__4_8_3opensource__Debug\Makefile [debug] Error 2
    10. 13:27:02: The process "C:\Qt\qtcreator-2.5.2\bin\jom.exe" exited with code 2.
    11. Error while building/deploying project yet_more_ogl (target: Desktop)
    12. When executing step 'Make'
    To copy to clipboard, switch view to plain text mode 
    I'm not sure what I did wrong, as I followed the tutorial almost exactly. The one difference is that I kept the menu bar at the top of the main window, since it would come in handy later. I don't see how that should break by build. Can anyone suggest something I should try?

  2. #2
    Join Date
    Nov 2012
    Posts
    18
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGL in QTcreator 2.5.2

    Hmm, I'm not sure how to edit my previous post. I believe I've solved the problem; for some reason rebooting the computer and reloading the project fixed the issue.

    However, now I can't get GLEW to work. I've made sure to include it before any QGL includes, and the project builds fine if I don't call any glew functions. But if I have glewInit in the initializeGL function, QTCreator complains:
    Qt Code:
    1. glwidget.obj:-1: error: LNK2019: unresolved external symbol __imp__glewInit@0 referenced in function "public: virtual void __thiscall GLWidget::initializeGL(void)" (?initializeGL@GLWidget@@UAEXXZ)
    To copy to clipboard, switch view to plain text mode 
    I'm not sure what's off here. I have the #include in the right place and all. I had glew32.lib in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib, but the error persisted even after I moved it to C:\Qt\4.8.3opensource\lib. Do I have to set up the linker somehow?

Similar Threads

  1. QtCreator and RPM
    By bob2oneil in forum Qt Tools
    Replies: 2
    Last Post: 20th December 2011, 14:52
  2. qtcreator v2.2
    By pkj in forum Qt Programming
    Replies: 1
    Last Post: 4th June 2011, 15:45
  3. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 12:58
  4. Replies: 1
    Last Post: 10th February 2010, 07:28
  5. AsM in QTCreator
    By XavierQT in forum Qt Programming
    Replies: 2
    Last Post: 8th June 2009, 02:09

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.