ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Combine VTK and Qt with visual studio in Windows...

Updated on May 20, 2011

Software needed :

1. Qt (ex : iam using Qt 4.7.1 ) Download location :

Note : download a setup that can be used with visual studio (ex: Qt libraries 4.7.3 for Windows (VS 2008, 230 MB))

2. vtk (ex : iam using vtk 5.6.1 ) Download location :

Note : Do not download the .exe file ,instead download the Source (that is in compressed form .zip)

3. visual studio (ex: iam using visual studio 2008 ) Download location : and their ar many other locations , you can try any.

4. cmake (ex: iam using cmake 2.8.3 ) Download location :


5: If you wanted to create qt projects in the visual studio then you can download add-in for it. Download :

Steps to Combine :

Step 1:

Install the Visual studio.

Step 2:

Install the Qt and set the environment variables for Qt (you can find these variables by opening qt command prompt).

Step 3:

open Qt command prompt , and type 'configure' and press enter and follow the steps.

we are all good ,if didn't find any error and command completed successfully.

Step 4:

Enter the command 'nmake' and hope for the successful completion without error. if command completed successfully then we are done with qt.

step 5:

extract the content of vtk source (.zip file) to the selected location.

step 6:

install cmake and run it. give the location of the folder that contains the extract of vtk source for source path and choose a folder location to build the binaries.After that press the configure button. after that you find a pop up ,that want's you to choose the generator for the project. choose the generator of visual studio as per version (ex : for my case 'visual studio 9 2008' ) and check the 'use default native compilers' and press the 'finish' button.

when 'configure' is complete you will find a screen like given below.

check the boxes 'vtk_uses_Qt' and other necessary boxes as per your requirement. After that press the button generate.On completion of 'generate' if you find some values in red, then again press 'configure' and on completion of 'configure' press 'generate'.

Now we are done with cmake, so close it.

Step 7:

Open the folder where you build the binaries for vtk. In this folder you find a file named 'VTK.sln'. Double click on that file (it will open with visual studio) and press the run it will start compiling the vtk binaries.It will take very much time.

after successful completion of compilation you will see a screen like below and if you didn't find this screen then don't worry about it.the only thing that matters is successful compilation.

press 'cancel'. this is not of any use for us.

Step 8:

After that ,In solution explorer ,you can see INSTALL. right click on it and choose build only install and click it. By Default it will produce a folder in c:/program files/VTK and sometimes it produces error due to administrative privileges.if you find any error then,you just have to change the security permission for that folder and try again.

Hope for successful completion like this.

Now we are all good and there is no further chances of compilation error in combining of vtk with qt, because we don't have to compile any more. But we not done yet.

Step 9:

Go to the 'Tools' menu and choose 'Options'.After that,you will see a pop-up ,choose 'Visual c++ directories' from 'Projects and Solutions'.

Add the directories for 'Executable files','Include files','Library files' and 'Source files'. you can do it easily by seeing these screen shots.

for conventions:

1vtk = the folder where you install vtk.

1qt = the folder where you install Qt.

vtk1 = the folder that is created , when you run 'build only INSTALL'. By default it is in c:/program files/VTK.

Congratulations , you are done and able to work with Qt and vtk together.

Check it by compiling an example :

we are all good, but for confirmation we need to compile an example. So, you can download this example from the given location.

Download Location : (here you find a folder named 'example' download it)

copy this folder in any selected location in your computer and open "visual studio command prompt" change the current directory in command prompt to the directory of example and run 'qmake -project'. after completion of command you will see a '' file in example directory.Close the command prompt and open ''. Edit it as given below.

change 'app' to 'vcapp'

add vtk include directory to the INCLUDEPATH

create a new variable LIBS and add all libraries of vtk to it.

Now open visual studio command prompt and change current directory to 'example'.Run the command 'qmake'. This will create 'example.vcproj'. double click on it. It will open with visual studio. Now click on run button and you will able to see the output.

Congratulations ,you just run an example that is using both Qt and vtk.

If you find any problem regarding combining of Qt and vtk. Just comment it here....

if you find this information useful then, please like it...


    0 of 8192 characters used
    Post Comment
    • profile image


      7 years ago

      hello, great article! could you upload your example code again? that would help me a lot! thanks!


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
    ClickscoThis is a data management platform studying reader behavior (Privacy Policy)