Tag Archives: VTK is combined with VS

Vtk7. X is compiled and installed under vs2013 and vs2015

To do a good job, a worker must first sharpen his tools
First of all, we need to prepare the required documents, which are as follows:
(1) cmake, download link cmake download. As for what CMAKE is, I will not introduce it, so a book, want to say it is hard to say. If you look at the suffix,.msi and.zip, you may wonder “what’s the difference?” In my opinion, zip is more convenient than msi.
(2) VTK file, divided into Source file and Data file. Download link VTK download link. Click the download link and you will see the picture.

Download zip files for source and zip files for data. Since I’m using VS here, I don’t need to download Python.
After downloading, it is decompressed. I used to decompress the files extracted from Data into the files extracted from Source. I stressed that I decompressed them separately, that is, decompressed them into two folders.
Two, start compiling
(1) Create a new folder in the folder after source unzipped, habitually named build, this folder is used to put the project related files after cmake.
(2) Open cmake

The source code bar is the path after unzips the source, and the build bar is the path of the project generated by CMAKE. The bin folder in the picture is not what I said above, so you can change the destination path to the build folder you created.
If you want to create a 64-bit VTK, you need to select the 64-bit VSXuan option. If you want to create a 64-bit VTK, you need to select the 64-bit VSXuan option
(3) Make the file options, the specific meaning of the options I will not say

This is the item that should be checked in Build.

This is the cmake group, but watch out for CMAKE_INSTALL_PREFIX. This is a very important one. You’ll notice that most of the blogs don’t talk about it at the moment, but it will make it much easier to use VTK.
Then is the intall road strength configuration, as shown below:

Represent the DLL path, the LIB path, and the VTK header path compiled with VS respectively. You need to set it up by yourself. In the future, you can use VTK just like OpenCV.

Because I’m using MFC, check the module_vtkguisupportMFC in the Module. Other options seem to be the default.
(4) Click the Configure button, and when the red color turns to white, click the Generate button to Generate the project.
Note: If there is an error when cmake is checked, it may be because the VS installation path has Chinese. Therefore, it is specially reminded that the installation path in Chinese should not appear.
(5) Finally, click Open ProJeroject to open the generated project in VS. As shown in figure:

Compile all_build, only install if successful.
While I’m using VS2015, other VSs do the same, I need to remind you that there is one more step you need to take before VS2013 is compiled, and that is to install multiple character sets.

The result after successful compilation is shown in the figure below:

As for the use, and you are familiar with the use of OpenCV is the same.
Because everyone’s level is different, I don’t know if it’s clear or not. If there is a lack of documents, or what questions can be left in the blog question, we discuss together.
And finally, the aforementioned book:

These are books about learning VTK, ITK, and CMAKE. Please leave a comment below if you need any.