PDA

View Full Version : Problem - Kernel32.lib



Guilherme Dantas
20th October 2012, 14:05
Hello all,

I am new to QT, and I tried to reinstall the QT-SDK 5 times, but the following problem persists: when I try to compile the program, the message
:-1: error: LNK1104: cannot open file 'kernel32.lib'. (It happens with all programs that I try to compile)

More details of the output:

14:55:25: Running build steps for project teste...
14:55:25: Configuration unchanged, skipping qmake step.
14:55:25: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
link /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\teste.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\teste.exe @C:\Users\GUILHE~1\AppData\Local\Temp\teste.exe.43 84.0.jom
C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
jom: C:\Users\Guilherme Dantas\teste-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2008__Qt_SDK__Debug\Makefile.Debug [debug\teste.exe] Error 1104

jom 1.0.8 - empower your cores

jom: C:\Users\Guilherme Dantas\teste-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2008__Qt_SDK__Debug\Makefile [debug] Error 2
14:55:26: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project teste (target: Desktop)
When executing build step 'Make'

My operating system: Windows 7 - 64 bits
Version of QT Creator: 2.4.1

More informations: I also use microsoft visual studio 2010. I tried to install mingw in my QT Creator and the error is still present. I also found the kernel32.lib in my computer, it's in the following directory:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib

I would like to know how I can make my QTCreator work. I don't care if I will use mingw or the visual studio compilator, I just would like to have a fast solution

I fould in the internet other ppl asking the same thing but the answers are not precise for a beginner or are not clear.
Example:
http://stackoverflow.com/questions/3926866/lnk1104-cannot-open-file-kernel32-lib

Thanks in advance,
Guilherme

wysota
20th October 2012, 16:21
How did you inform the compiler where to find that library?

Guilherme Dantas
20th October 2012, 19:49
Good question wysota: Actually I did not do anything: the configurations of the compiler, of the linker, etc. were all automatically determined after I install the program (and I do not know how to configure the kernel32.lib path - that would be interesting, and would maybe solve my problem). I tried to install Mingw, I tried to change some building configurations, but I still cannot find the root of my problem.

wysota
20th October 2012, 20:17
Good question wysota: Actually I did not do anything:
So it's not surprising it can't find it :)


the configurations of the compiler, of the linker, etc. were all automatically determined after I install the program (and I do not know how to configure the kernel32.lib path - that would be interesting, and would maybe solve my problem). I tried to install Mingw, I tried to change some building configurations, but I still cannot find the root of my problem.

How did you tell your compiler to actually try to link with kernel32?

Guilherme Dantas
20th October 2012, 21:32
I did not tell anything to my compiler, I just installed the program and the configurations were automatically set.

8337

I do not know how to choice the path of my kernel32.lib and every configuration that I use was auto-detected. How could I actually inform my compiler to not use kernel32.lib or to use a correct path for it? I am a complete beginner with QT

wysota
20th October 2012, 21:54
I did not tell anything to my compiler, I just installed the program and the configurations were automatically set.
Do you need kernel32.lib for anything then? What are you trying to build?

I don't think Qt has anything to do with this. The problem seems to be with your MSVC installation.

Guilherme Dantas
20th October 2012, 23:47
I really don't need kernel32.lib, It's just for a simple project of a discipline of my university...and my visual studio works perfectly. So, how could I solve the problem?

Thanks for all the help

cqubed
21st October 2012, 02:09
If you are familiar with MS VS-2010. It will probably be easier for you to work from there.
You've already installed QT SDK so all you need to do is install the QT MS Visual Studio 2010 add-in. Just Google "qt-vs-addin-1.1.11-opensource.exe" to find where to download from.
Make sure you set the environment variable QTDIR to point to QT install directory (c:\Qt\4.4.8 or something like that).

The VS add-in should take care of setting up everything else. It adds templates for Qt projects to your New Project dialog.

wysota
21st October 2012, 07:13
I really don't need kernel32.lib, It's just for a simple project of a discipline of my university...and my visual studio works perfectly. So, how could I solve the problem?

So what does your project file look like?

ChrisW67
21st October 2012, 07:43
More details of the output:

14:55:25: Running build steps for project teste...
14:55:25: Configuration unchanged, skipping qmake step.
14:55:25: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
link /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2008\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\teste.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\teste.exe @C:\Users\GUILHE~1\AppData


From that link command it looks like the Qt binaries installed are MSVC 2008.
Guilherme is using MSVC 2010 in Visual Studio 2010 which is a binary mismatch.
In the Qt SDK updater download and use the MSVC 2010 Qt libraries rather than the 2008 ones.