The first thing that you will want to do is install the Qt sdk. It can usually be found at http://qt.nokia.com/downloads. You can do the quick install or choose to do a custom install. That is up to you for what you may want to include on the install.
Next, you will want to install the Qt Visual Studio Add-in. It is also usually found at http://qt.nokia.com/downloads. You can follow the default settings.
Setting Up the Environment Variable
Once these are installed, you will need to set the PATH environment variable. In order to do this, do the following;
- Click on the Start Menu
- Right Click on Computer
- Click on Properties
- You will now need to determine where the product was installed in order to determine what value to add to the Path. You will want to find the bin directory for the source. For instance, when I installed 4.7.4, the program was installed in C:\QtSDK\QtSources\4.7.4\bin. This would be the value I would add to the Path variable. Be careful with your formatting when adding the value.
Building the Qt Library
We will want to build the Qt Library now. This is where it gets a little tricky especially if you have multiple versions of Visual Studio installed or other C++ compilers.
In order to build, you will want to do the following:
- Open a command line prompt, but with the environment variables set for Visual Studio. You can do this from the tools folder in VS. I will use VS 2010 as an example.
- On the command line, navigate to the directory where Qt was installed. For me, it would be C:\QtSDK\QtSources\4.7.4\.
- Now, on the command line you will want to run the configure command. It will look like the following:
configure -platform win32-msvc2010
Notice where I have win32-msvc2010. This will be different for you depending on which version of Visual Studio you have on your machine or want to use. - Now run the following:
nmake
Qt has now been build
Configure Qt in Visual Studio
Once we have these steps done, we will need to configure Qt in VS. In order to do this, do the following.
- Make sure the Qt Versions Tab is Selected and Click the Add Button
- Add a version name and select the path to the version. For me the path would be C:\QtSDK\QtSources\4.7.4
You should now be able to create a Qt project inside of Visual Studio with no issues.
No comments:
Post a Comment