Vtk5.6 installation and configuration tutorial

Source: Internet
Author: User

1. Download required:
Vtk-5.6.0-win32.exe
Source vtk-5.6.0.zip Program
Vtkdata-5.6.0.zip data
(VTK related installer download: http://vtk.org)
Cmake-2.8.2-win32-x86.zip
(Cmake download: http://www.cmake.org/HTML/Index.html)

 

2. Install vtk-5.6.0-win32.exeTo D: \ VTK 5.6, after the installation is complete, the vtk5.6 folder will generate the bin, include, and Lib subfolders at the same time.

 

3. Unzip the vtk-5.6.0.zip to D: \ VTK 5.6 \ VTK and unzip vtkdata-5.6.0.zip to D: \ VTK 5.6 \ vtkdata

  

4. Unzip the cmake-2.8.2-win32-x86.zip and run {unzip directory} \ bin \ cmake-gui.exe, Set the sourse code directory to D: \ VTK 5.6 \ VTK \, And the build directory to D: \ Program Files \ VTK 5.6 \ bin \
Press the Configure button and select the Visual Studio 9 2008 compiler. Then, cmake will describe the required files.
Select "advanced" and press "Configure". You can see a vtk_use_guisupport. Select "Configure", select "vtk_use_mfc", and then "Configure". The number of configure times does not matter.

Build_shared_libs: if it is set to off, only the Lib file is generated. If it is set to on, more DLL files will be generated. These DLL files must be copied to the Windows/system directory. If you use static library programming, that is, off, the application can run independently and the size is relatively large. If you use dynamic library programming, that is, on, the application must find a dynamic library to run.

After all the items are dimmed, you can click Generate. when the project is finished, generating done is displayed, and cmake is disabled.

 

5. Use VC ++ 2008 to open the materiallibrary. sln file under the D: \ VTK 5.6 \ bin \ utilities \ materiallibrary directory, right-click all_build and choose regenerate.

  

6. If build_shared_libs is selectedCopy the vtksys. dll file generated in D: \ VTK 5.6 \ bin \ debug to the Windows/system directory.

 

7. Open VTK. sln in the d: \ Program Files \ VTK 5.6 \ bin directory, right-click all_build and choose regenerate.
(If build_shared_libs is set to on, an error will occur in the example involving MFC in the middle, and then D: all DLL files generated in \ VTK 5.6 \ bin \ debug are copied to the Windows/system directory. Is getting started, so this article does not handle the problem of MFC errors .)
Right-click cone6 and choose debug> Start new instance. Then, the program runs correctly.

 

8. Create a project test (empty project of the console application), add the test. cpp file, and overwrite the content of test. cpp with the file content of cone6.cxx.

  

8.1 Add a directory to the configuration, which is located in Project Properties> Configuration Properties> C/C ++/GeneralThe first item of the instance, which includes the following content (you can view the additional include directory of the Instance ):

"D: \ VTK 5.6 \ bin"; "D: \ VTK 5.6 \ bin \ common"; "D: \ VTK 5.6 \ bin \ utilities"; "D: \ VTK 5.6 \ bin \ volumerendering ";" D: \ VTK 5.6 \ bin \ rendering ";" D: \ VTK 5.6 \ bin \ Charts ";" D: \ VTK 5.6 \ bin \ guisupport \ MFC ";" D: \ VTK 5.6 \ bin \ utilities \ vtkalglib ";" D: \ VTK 5.6 \ VTK \ infovis ";" D: \ VTK 5.6 \ VTK \ geovis ";" D: \ VTK 5.6 \ VTK \ views ";" D: \ VTK 5.6 \ VTK \ volumerendering ";" D: \ VTK 5.6 \ VTK \ hybrid ";" D: \ VTK 5.6 \ VTK \ widgets ";" D: \ VTK 5.6 \ VTK \ rendering ";" D: \ VTK 5.6 \ VTK \ Charts ";" D: \ VTK 5.6 \ VTK \ rendering \ Testing \ cxx ";" D: \ VTK 5.6 \ VTK \ Io ";" D: \ VTK 5.6 \ VTK \ imaging ";" D: \ VTK 5.6 \ VTK \ graphics ";" D: \ VTK 5.6 \ VTK \ genericfiltering ";" D: \ VTK 5.6 \ VTK \ filtering ";" D: \ VTK 5.6 \ VTK \ common ";" D: \ VTK 5.6 \ VTK \ utilities ";" D: \ VTK 5.6 \ VTK \ common \ Testing \ cxx ";" D: \ VTK 5.6 \ bin \ utilities \ vtklibproj4 ";" D: \ VTK 5.6 \ VTK \ utilities \ vtklibproj4 ";" D: \ VTK 5.6 \ bin \ utilities \ dicomparser ";" D: \ VTK 5.6 \ VTK \ utilities \ dicomparser "; "D: \ VTK 5.6 \ bin \ utilities \ vtkfreetype \ include"; "D: \ VTK 5.6 \ VTK \ utilities \ vtkfreetype \ include"; "D: \ VTK 5.6 \ bin \ utilities \ vtknetcdf ";" D: \ VTK 5.6 \ VTK \ utilities \ vtknetcdf ";" D: \ VTK 5.6 \ bin \ utilities \ vtkexodus2 \ include ";" D: \ VTK 5.6 \ VTK \ utilities \ vtkexodus2 \ include ";" D: \ VTK 5.6 \ bin \ utilities \ materiallibrary ";" D: \ VTK 5.6 \ VTK \ utilities \ materiallibrary ";" D: \ VTK 5.6 \ bin \ utilities \ verdict "; "D: \ VTK 5.6 \ VTK \ utilities \ verdict"; "D: \ VTK 5.6 \ VTK \ utilities \ utf8 \ source"; "D: \ VTK 5.6 \ VTK \ guisupport \ MFC ";" D: \ VTK 5.6 \ VTK \ utilities \ vtkalglib ";" D: \ VTK 5.6 \ VTK \ utilities \ ftgl \ SRC ";" D: \ VTK 5.6 \ bin \ utilities \ ftgl ";

 

8.2 Add a dependency at Project Properties> linker> Input(You can view the attached directory of the instance. Do not directly take responsibility for this .. \.. \ content. to copy the content directly, make sure that the new project and the project to be copied are in the same folder ):

Kernel32.lib
User32.lib
Gdi32.lib
Winspool. Lib
Comdlg32.lib
Advapi32.lib
Shell32.lib
Ole32.lib
Oleaut32.lib
UUID. Lib
Odbc32.lib
Odbccp32.lib
"D: \ VTK 5.6 \ bin \ debug \ vtkwidgets. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkhybrid. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkrendering. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkgraphics. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkimaging. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkio. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkfiltering. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtkcommon. lib"
"D: \ VTK 5.6 \ bin \ debug \ vtksys. lib"
Ws2_32.lib

 

8.3 right-click cone6 and choose debug> Start new instance. The cane6 instance window is displayed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.