Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the Windows SDK with Qt Creator

Tags:

windows

qt

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?

like image 720
Cev Avatar asked Sep 24 '10 23:09

Cev


People also ask

What is Qt SDK?

Qt SDK leverages the power of the Qt framework and tools, combining them with tools designed specifically to streamline the creation of applications for mobile platforms, such as Symbian and Maemo in addition to desktop platforms, such as Microsoft Windows, Mac OS X, and Linux.

Where is Stddef h in Windows?

stddef. h is in C:\Program Files (x86)\Windows Kits\10\Include\10.0.

Can I use Qt without Visual Studio?

Yes. And even without Windows, if you don't need Windows specifically. The IDE that is shipped with Qt Framework is QtCreator.

Is Qt Creator better than Visual Studio?

When comparing Microsoft Visual Studio vs Qt Creator, the Slant community recommends Qt Creator for most people. In the question“What are the best IDEs for C++ on Linux?” Qt Creator is ranked 1st while Microsoft Visual Studio is ranked 23rd.


1 Answers

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

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

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

like image 73
Piotr Dobrogost Avatar answered Oct 28 '22 05:10

Piotr Dobrogost