Visual Studio 2012 alongside 2010 - kernel32.lib, windows.h

前端 未结 2 736
臣服心动
臣服心动 2021-02-14 14:41

I just installed Visual Studio 2012 alongside Visual Studio 2010. The problem is that I can\'t manage to convert simple projects from 2010 to 2012 - they fail to link to files s

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-14 15:00

    I know there's almost an answer above. But...

    The problem seems to be that when VS2012 and VS2010 are installed, the configuration for VS2012 does not work correctly.

    The fix is to edit the props files in %home%\AppData\Local\Microsoft\MSBuild\v4.0.

    These are the files that worked for me, using SDK v8.1.

    First Microsoft.Cpp.Win32.user.props which is used for 32-bit builds:

     
    
      
        C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;$(IncludePath)
        C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;$(LibraryPath)
        C:\Program Files (x86)\Windows Kits\8.1\bin\x86;$(ExecutablePath)
      
    
    

    Now Microsoft.Cpp.x64.user.props which is used for 64 bit builds:

     
    
      
        C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;$(IncludePath)
        C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64;$(LibraryPath)
        C:\Program Files (x86)\Windows Kits\8.1\bin\x64;$(ExecutablePath)
      
    
    

    I hope this helps others with this problem, I haven't found a solution posted anywhere else.

提交回复
热议问题