Qt Creator - LNK1104: cannot open file "glu32.lib"

XHotSniperX picture XHotSniperX · Mar 3, 2014 · Viewed 8.4k times · Source

I am using Qt and Qt Creator and I want to run a test file to see if my Installation is correct or not. I use Windows 8.1 64 bit. I installed the newest Qt OpenGL 64 bit Version for Windows.

I already included the file glu32.lib by doing this in my .pro file:

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/C:/Program Files (x86)/Windows 

Kits/8.1/Lib/winv6.3/um/x64/ -lGlU32
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64/ -lGlU32d

INCLUDEPATH += $$PWD/C:/Program Files (x86)/Windows Kits/8.1/Include/um/gl
DEPENDPATH += $$PWD/C:/Program Files (x86)/Windows Kits/8.1/Include/um/gl

That did not fix it. The file exists in that Folder. Can you help me please?

Answer

lpapp picture lpapp · Dec 27, 2014

First of all, it is case sensitive.

Secondly, you do not need to add the debug marker explicitly, so just write this:

LIBS += glu32

rather than:

LIBS += Glu32d

Also, as Martin pointed out in a comment, you better double quote strings containing spaces as follows:

-L"$$PWD/C:/Program Files (x86)/Windows"

or this if you fancy:

-L$$quote($$PWD/C:/Program Files (x86)/Windows)

Furthermore, this does not make any sense as the second branch will never satisfy:

win32: ...
else: win32: ...

If you do not want to go editing the project file, you can use the QtCreator GUI to add a system library like glu:

enter image description here

Furthermore, you seem to have 64 bit Qt installed on Windows, but you are trying to use 32 bit glu. Do not do that. Use either 32 bit for both or 64 bit.