none
fatal error LNK1104: cannot open file 'kernel32.lib' VS2005 Windows 2004 64 bit Visual C++

    Question

  •  

    I am trying to compile a VC++ project using the x64 compilers. the project compiles fine when compiling with 32 bit configuration. When I tried to compile the project with x64 bit configuration, it gives the following error while linking

     

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

     

    The linker command from the project propertied is as follows:

     

    /OUT:".\Debug/dmiservice.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\dmiservice.exe.intermediate.manifest" /DEBUG /PDB:".\Debug/dmiservice.pdb" /SUBSYSTEM:WINDOWS

    /MACHINE:X64 /ERRORREPORTROMPT lib\jvm.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

     

    This is where kernel32.lib is used as additional resources.

     

    When I removed the references from the linker as follows

     

    /OUT:".\Debug/dmiservice.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\dmiservice.exe.intermediate.manifest" /DEBUG /PDB:".\Debug/dmiservice.pdb" /SUBSYSTEM:WINDOWS

    /MACHINE:X64 /ERRORREPORTROMPT lib\jvm.lib

     

    I get the following errors.

    .\debug\DatatelEventLog.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

     

    I am using vs2005 as follows.

     

    Microsoft Visual Studio 2005
    Version 8.0.50727.42  (RTM.050727-4200)
    Microsoft .NET Framework
    Version 2.0.50727

    Installed Edition: Professional

    Microsoft Visual Basic 2005   77626-009-0000007-41189
    Microsoft Visual Basic 2005

    Microsoft Visual C# 2005   77626-009-0000007-41189
    Microsoft Visual C# 2005

    Microsoft Visual C++ 2005   77626-009-0000007-41189
    Microsoft Visual C++ 2005

    Microsoft Visual Web Developer 2005   77626-009-0000007-41189
    Microsoft Visual Web Developer 2005

     

    When I compile the same project in another 64 bit machine, the project compiles fine. The only difference between the computer in which it compiles fine just has windows 2003 SP1 whereas the comp I am trying to use has Windows 2003 standard x64 edition with SP2.

    Can any please help me resolve this.

     

    Thanks

    Monday, June 18, 2007 5:12 PM

Answers

  • OK first of all, have you installed the full set of compiler and libraries?

    Secondly are your paths correct?

     

    If it can't find kernel32.lib then it is possible that you haven't got the x64 compiler and libraries installed on yours, or somehow your paths have been messed up. If also, it is compiling it and ending up witn an x86 object then I think this really is the case.

     

    Double check by going to the VS2005 setup in Add Remove programs and double check that the x64 compiler and libs are installed.

    Monday, June 18, 2007 7:05 PM

All replies

  • OK first of all, have you installed the full set of compiler and libraries?

    Secondly are your paths correct?

     

    If it can't find kernel32.lib then it is possible that you haven't got the x64 compiler and libraries installed on yours, or somehow your paths have been messed up. If also, it is compiling it and ending up witn an x86 object then I think this really is the case.

     

    Double check by going to the VS2005 setup in Add Remove programs and double check that the x64 compiler and libs are installed.

    Monday, June 18, 2007 7:05 PM
  • yes it solved the issue. thanks
    Monday, June 25, 2007 2:06 PM
  • what if I dont have that File?
    Wednesday, November 10, 2010 11:01 AM