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?