C++ – Qt Creator LNK1104: cannot open file ‘glu32.lib’

cqtvisual c++

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.

Best Answer

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.

Related Topic