Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set up Qt paths in Visual Studio 2010?

I just downloaded and installed the latest versions of the Qt SDK, Qt Creator, and the Qt add-in for Visual Studio (I'm running VS 2010).

First, I tried creating a Qt project in VS2010. It came up with

Unable to find a Qt build!

To solve this problem specify a Qt build

So I go to the Qt -> Qt Options menu item in VS and click Add for the version.

Now, I have 2 qmake.exe files: one in C:\Qt\2010.05\qt\qmake and one in C:\Qt\2010.05\qt\bin

For some reason, if I select either one of these files, it comes up with the error message the this version of Qt was built with MingW. (I don't see why it makes a difference what compiled it, just so long as it's compiled?)

After spending some time trying to find a working qmake.exe for the VS add-in I gave up and tried to get the original Qt creator to work instead.

Qt creator is also not configured to run with itself (lol). When I select the path to either of my 2 qmake.exe files, it comes up with an error message when I try to compile a small program:

Could not find make command: make in the build environment

Error while building project untitled (target: Desktop)

When executing build step 'Make'

When I check the options in Qt creator, it says qmake is at version 4.7.0 and that

Qt version is not properly installed, please run make install

The VS2010 add-in is installed to my program files (x86) folder, but there are no qmake.exe files there.

I'm running Windows 7 x64.

like image 335
Ozzah Avatar asked Feb 21 '11 07:02

Ozzah


People also ask

How does qt integrate with Visual Studio?

In Microsoft Visual Studio, select Extensions > Manage Extensions > Online, and search for Qt Visual Studio Tools to install or update Qt VS Tools.

Does Visual Studio support qt?

The Qt Visual Studio Tools integrate the Qt development tools into Microsoft Visual Studio. This enables developers to use the standard Windows development environment without having to worry about Qt-related build steps or tools.

Should I use Qt Creator or Visual Studio?

In the end it comes down to preferences if you want to use Qt Creator or Visual Studio for development. It is easy to create a VS project file from Qt project files using qmake. I prefer using Qt Creator because I can navigate a lot faster. My colleague, however, uses Visual Studio.


1 Answers

I'm almost positive that you have to rebuild the Qt libraries in Visual Studio first before you can use them. That probably explains why you're getting the error message that a Qt build can't be found, and that the version of Qt you're using was built with MinGW.

I suggest reading this blog post for what looks to be a solid how-to guide on integrating Qt with VS.

This looks like an even simpler guide, although it's in PDF format: Qt Installation for Visual Studio

like image 181
Cody Gray Avatar answered Sep 28 '22 11:09

Cody Gray