3
votes

I have been learning C++ for about a year now, not a complete noobie, but recently decided to learn how to create GUIs, so after a little research I figured Qt was the tool for me.

Grabbed Qt and wanted to get into the Qt Creator following thenewboston's Youtube tutorials, but any (even empty) project I attempt to run gets an error

LNK1104: cannot open file 'glu32.lib'. 

I've been scouring the internet for a solution to this problem for a while - the question has been posed a few times, but solutions either don't apply to me or I can't make head or tail of them (I'm still somewhat of a noobie in many respects).

I could really use some advice on this.

Edit: @hyde Here's the compiler output:

17:58:09: Running steps for project untitled...

17:58:09: Configuration unchanged, skipping qmake step.

17:58:09: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe"
C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
echo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID / 24 / RT_MANIFEST */ "debug\untitled.exe.embed.manifest">debug\untitled.exe_manifest.rc

if not exist debug\untitled.exe if exist debug\untitled.exe.embed.manifest del debug\untitled.exe.embed.manifest

if exist debug\untitled.exe.embed.manifest copy /Y debug\untitled.exe.embed.manifest debug\untitled.exe_manifest.bak

link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /MANIFEST /MANIFESTFILE:debug\untitled.exe.embed.manifest /OUT:debug\untitled.exe @C:\Users\Immi\AppData\Local\Temp\untitled.exe.3464.31.jom

LINK : fatal error LNK1104: cannot open file 'glu32.lib'

jom: C:\Qt\Tools\QtCreator\bin\build-untitled-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile.Debug [debug\untitled.exe] Error 1104

jom: C:\Qt\Tools\QtCreator\bin\build-untitled-Desktop_Qt_5_3_MSVC2012_OpenGL_32bit-Debug\Makefile [debug] Error 2

17:58:10: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.

Error while building/deploying project untitled (kit: Desktop Qt 5.3 MSVC2012 OpenGL 32bit)

When executing step "Make"

17:58:10: Elapsed time: 00:01.

2
Please add the console output of the clean build of your "empty" project (by which I assume, just empty main function or something) to the question. Also tell what Qt Creator Kit you are using (for example, "Desktop Qt 5.2.1 MSVC2010 32bit OpenGL" is one I have). - hyde
Also, try dir /s C:\glu32.lib and see where you have that file, if anywhere. - hyde
Sorry, I mis-phrased that - it doesn't even compile, so there is no build and no console output. I'm using Qt 5.3.2 MSVC2010 32bit OpenGL. I do appear to have the file numerous times, either in subdirectories of C:\Program Files\Microsoft SDKs\ or C:\Program Files (x86)\Microsoft SDKs\ - BlueTooth4269
Sorry, I mistyped! I meant, add compile output (which you do have if you got linker error). - hyde
Anyway, one solution is to install the MinGW version (easy with online installer, if you have decent internet connection), it's what I usually use on Windows. Or just try re-installing what you have now, in case the installation was somehow botched up. Also, make sure you have up-to-date display drivers from your GPU maker (that shouldn't matter with build time problems, though, just saying). - hyde

2 Answers

2
votes

I had the same problem and I solved it like this:

  • In Qt Creator I selected Projects.
  • In Build & RunBuild Enviroment I clicked Details.
  • I started to edit the LIB variable and added the following to the string C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\ (you need to have some Windows SDK installed).

Now then I rebuild my project it compiled and I was able to run. But debugging wasn’t working. I solved that by reading on this page http://qt-project.org/doc/qtcreator-2.6/creator-debugger-engines.html where I found (after some guessing) that I needed to install Get the standalone debugging tools (WinDbg) as part of Windows 8.1 SDK from this page: http://msdn.microsoft.com/en-us/windows/hardware/hh852365

Personal note: I you are new to GUI development I would recommend that you start to look on something else. I’m not saying QT is bad in any way, but it feels like the environment could you cause a lot of problem which may take your motivation away (to be fair: I’m a QT newbie). I would start with C# (very easy if you know C++) and create some programs with Visual Studio – it’s very easy to learn and you will be productive and creative and having fun which is important when you want to learn something.

0
votes

Make sure that the .pro file contains the following:

QT       += core gui opengl
LIBS     += opengl32.lib -lglu32