我刚刚在带有 SP3 的 Windows XP Professional 上安装了 Windows SDK 7.1。现在我正在检查安装是否正常,并且我已经遇到了问题。我仍然无法让 cl.exe 从 Windows SDK 7.1 命令提示符编译一个简单的 hello world C++ 代码。这是命令提示符输出的快照:
Setting SDK environment relative to C:\Program Files\Microsoft SDKs\Windows\v7.1\.
Targeting Windows XP x86 Debug
C:\Program Files\Microsoft SDKs\Windows\v7.1>cd /d "D:\My Documents\Sources"
D:\My Documents\Sources>cl /EHsc /FeD:\Target\hello hello.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
hello.cpp
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1104: cannot open file 'C:\Documents'
我尝试移至hello.cpp
D:\ 并得到相同的结果。另一方面,CSC.exe 在同一命令提示符下顺利编译了 hello world C# 代码。我现在该怎么办?
请注意,我没有安装任何版本的 Visual Studio。我安装了 Windows SDK,以便可以在 Qt Creator 中使用用于 VS2010 的 Qt Framework 4.8.0,并在 SharpDevelop 中学习一点 C#。