6

I ran into this problem recently (few days ago everything was working fine): Visual Studio 2012 started to refuse to build native WP8 projects.

Today, I created new solution from template 'Windows Phone Direct3D App (Native Only)' to check if my newly created DLLs will be properly supported on WP. I tried to compile this project, first without any changes or additional references - pure code generated by VS. However, it failed with given error. I know very well what does it mean and what could be the possible reason, but I can't understand, hovewer, where does it come from in this case. Weird thing: this only happens in 'Win32' configuration, ARM compiles fine:

1>------ Build started: Project: PhoneDirect3DApp, Configuration: Debug ARM ------
.......

Build Summary
-------------
00:11.742 - Success - Debug ARM - PhoneDirect3DApp\PhoneDirect3DApp.vcxproj

but Win32 does not:

1>------ Build started: Project: PhoneDirect3DApp, Configuration: Debug Win32 ------
.......
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

Build Summary
-------------
00:09.725 - Failed  - Debug Win32 - PhoneDirect3DApp\PhoneDirect3DApp.vcxproj

My standard (native C++/Win32) projects also work as expected (in both Win32 and x64 platform targets).

Project configuration: (in both platforms)

Linker::Input:

d3d11.lib;%(AdditionalDependencies)

Linker::Ignore:

ole32.lib;%(IgnoreSpecificDefaultLibraries)

VC++ Directories:

Microsoft.ARM.Cpp.User:

$(WP80ToolSetPath)lib\arm;$(WindowsSDK_LibraryPath_ARM);

Microsoft.Win32.Cpp.User:

$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WP80ToolSetPath)lib\x86;$(WindowsSDK_LibraryPath_x86)

Any ideas what else could be wrong or configured incorrectly? I'm running out of ideas, I have never seen something like this before.

By the way, I have noticed one more change: when I was trying to compile WP8 projects in ARM configurtion before, there was always an error, saying "building ARM application on desktop is not supported" (or something like that). Now ARM compiles with no problem. Is it normal?

4

1 回答 1

9

最后,我找到了问题的原因:正如我所怀疑的,内部 Visual Studio 配置已被破坏。

我做了所有标准步骤,可以在 LNK1104 的情况下执行,但是:

- kernel32.lib 位于有效位置
- 所有包含和库目录都是正确的
- 标准 *.props 文件附加到每个项目

然而,原因在于其他地方。

所有路径均使用标准宏定义。其中之一是 $(WindowsSDK80Path),用于构建包含/库路径。在我的系统上,这个宏被定义为

C:\Program Files (x86)\Windows Phone Kits\8.0

代替

C:\Program Files (x86)\Windows Kits\8.0

就是这样。我不知道这个问题是何时或如何出现的。通过原始安装程序修复 Visual Studio 足以修复所有问题。所有项目现在编译没有任何问题。

于 2014-01-13T00:18:17.583 回答