如何在 Qt Creator 中使用 Windows SDK [英] How can I use the Windows SDK with Qt Creator

查看:112
本文介绍了如何在 Qt Creator 中使用 Windows SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试在 Qt Creator 中使用 Windows SDK v7.1,但运气不佳.具体来说,我如何设置 Qt Creator 以便它编译 C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples 中的 SDK 示例?

I have been trying to use the Windows SDK v7.1 in Qt Creator without much luck. Specifically, how can I set up Qt Creator so that it will compile the SDK samples in C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples?

推荐答案

在Qt Creator中使用File|New File or Project创建新项目,从Other Project中选择Other Projectem>Projects 列表,然后选择 Import Existing Project 并单击 Choose... 按钮.然后选择带有 SDK 示例的文件夹,单击 Next,然后单击 Finish.单击左侧的Projects(或按Ctrl+5),然后在工具链 组合中选择Microsoft Visual C++.现在点击Build Environment下的Details,检查清除系统环境和变量及其值如下:

Create new project in Qt Creator using File|New File or Project, choose Other Project from Projects list and then choose Import Existing Project anc click Choose... button. Then select the folder with SDK example, click Next and click Finish. Click Projects on the left (or press Ctrl+5), and in Tool chain combo choose Microsoft Visual C++. Now click Details under Build Environment, check Clear system environment and variables and their values as below:

COMSPEC   C:\Windows\system32\cmd.exe
INCLUDE   C:\Program Files\Microsoft SDKs\Windows\v7.1\Include;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include;
LIB       C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\lib;
PATH      C:\Windows\System32;C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;
PROCESSOR_ARCHITECTURE x86

您应该根据您的设置(安装 Visual C++ 的位置和安装 Windows SDK 的位置)修改上述值.

You should modify above values according to your setup (places where you installed Visual C++ and where you installed Windows SDK).

现在点击 Build All(或按 Ctrl+Shift+B),示例应该被构建.

Now click Build All (or press Ctrl+Shift+B) and the example should be built.

这篇关于如何在 Qt Creator 中使用 Windows SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆