VTK 5.10.1 VS2010 Configuration 配置

Download VTK 5.10.1

Download VS2010

Download CMake 3.2.0

I assume you‘ve already installed VS2010 and CMake 3.2.0 correctly.

Compile the VTK:

Start CMake 3.2.0, fill the source and destination:

source: C:/VTK5.10.1/VTK5.10.1

destination: C:/VTK5.10.1/VS2010

Click Configure and use Visual Studio 10 2010 to complie.

When first configure is done, select Grouped and Advanced.

BUILD_EXAMPLES          [ON]
BUILD_TEST              [ON]
CMAKE_INSTALL_PREFIX    [C:/VTK5.10.1/VS2010_install]
CMAKE_USE_PTHREADS      [OFF]
CMAKE_USE_WIN32_THREADS [ON]  

click Configure again.

After configure is done (No errors show), click Generate.

Go back to your build folder, open VTK.sln, right click ALL_BUILD, choose Rebuild.

Wait a long time for make process, have a cup of coffee :)

After rebuild is done, right click INSTALL, choose Build.

Now, the configuration is done, enjoy it :)

Create a new empty project,

Project->Project Property->Configuration Properties->VC++Directories ->Include Directories:

C:\VTK5.10.1\VS2010
C:\VTK5.10.1\VS2010\bin
C:\VTK5.10.1\VTK5.10.1\GenericFiltering
C:\VTK5.10.1\VTK5.10.1\Common
C:\VTK5.10.1\VTK5.10.1\IO
C:\VTK5.10.1\VTK5.10.1\Filtering
C:\VTK5.10.1\VTK5.10.1\Rendering
C:\VTK5.10.1\VTK5.10.1\Graphics
C:\VTK5.10.1\VTK5.10.1\olumeRendering
C:\VTK5.10.1\VTK5.10.1\Imaging
C:\VTK5.10.1\VTK5.10.1\Hybrid
C:\VTK5.10.1\VTK5.10.1\GUISupport
C:\VTK5.10.1\VTK5.10.1\Utilities
C:\VTK5.10.1\VS2010\Utilities
C:\VTK5.10.1\VTK5.10.1\Parallel
C:\VTK5.10.1\VTK5.10.1\Widgets

Project->Project Property->Configuration Properties->VC++Directories ->Library Directories:

C:\VTK5.10.1\VS2010\bin\Debug

Project->Project Property->Configuration Properties->Linker->Input:

opengl32.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
vtkCommon.lib
vtkDICOMParser.lib
vtkexoIIc.lib
vtkexpat.lib
vtkFiltering.lib
vtkfreetype.lib
vtkftgl.lib
vtkGenericFiltering.lib
vtkGraphics.lib
vtkHybrid.lib
vtkImaging.lib
vtkIO.lib
vtkjpeg.lib
vtkNetCDF.lib
vtkpng.lib
vtkRendering.lib
vtksys.lib
vtktiff.lib
vtkVolumeRendering.lib
vtkWidgets.lib
vtkzlib.lib

Create a test.cpp file as below:

#include <vtkConeSource.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>

int main(int, char *[])
{
    //Create a cone
    vtkSmartPointer<vtkConeSource> coneSource =
        vtkSmartPointer<vtkConeSource>::New();
    coneSource->Update();

    //Create a mapper and actor
    vtkSmartPointer<vtkPolyDataMapper> mapper =
        vtkSmartPointer<vtkPolyDataMapper>::New();
    mapper->SetInputConnection(coneSource->GetOutputPort());

    vtkSmartPointer<vtkActor> actor =
        vtkSmartPointer<vtkActor>::New();
    actor->SetMapper(mapper);

    //Create a renderer, render window, and interactor
    vtkSmartPointer<vtkRenderer> renderer =
        vtkSmartPointer<vtkRenderer>::New();
    vtkSmartPointer<vtkRenderWindow> renderWindow =
        vtkSmartPointer<vtkRenderWindow>::New();
    renderWindow->AddRenderer(renderer);
    vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
        vtkSmartPointer<vtkRenderWindowInteractor>::New();
    renderWindowInteractor->SetRenderWindow(renderWindow);

    //Add the actors to the scene
    renderer->AddActor(actor);
    renderer->SetBackground(.3, .2, .1); // Background color dark red

    //Render and interact
    renderWindow->Render();
    renderWindowInteractor->Start();

    return EXIT_SUCCESS;
}

If error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL‘: value ‘0‘ doesn‘t match value ‘2‘ occurs, please see solution here.

时间: 2024-10-14 10:39:37

VTK 5.10.1 VS2010 Configuration 配置的相关文章

ITK 3.20.1 VS2010 Configuration 配置

Download ITK 3.20.1 Download VS2010 Download CMake 3.2.0 I assume you've already installed VS2010 and CMake 3.2.0 correctly. Compile the VTK: Start CMake 3.2.0, fill the source and destination: source: C:/ITK3.20.1/InsightToolkit-3.20.1 destination: 

VTK 6.3.0 Qt 5.4 MinGW 4.9.1 Configuration 配置

Download VTK 6.3.0 Download Qt 5.4 with MinGW 4.9.1 Download CMake 3.2.0 I assume you've already installed Qt 5.4 with MinGW 4.9.1 and CMake 3.2.0 correctly. Pre-process the VTK: Open CMakeLists.txt in your extracted VTK-6.3.0 folder, find set(VTK_US

vs2010下配置coco2d-x

Cocos2d-x win7 + vs2010 配置图文详解(亲测) 下载最新版的cocos2d-x.打开浏览器,输入cocos2d-x.org,然后选择Download,本教程写作时最新版本为cocos2d-1.01-x-0.9.1,具体下载位置如下图: 下载完之后,解压到当前文件夹.我把下载的程序放在F盘根目录,解压完毕之后,双击打开文件夹,看看里面有什么东西,红圈部分就是我们要安装使用的文件: 接下来,我们正式安装cocos2d-x到win7中去. 首先,双击上图中的cocos2d-win

VS2010中配置OpenGL

下面将对VS2010中配置OpenGL进行简单介绍. 学习OpenGL前的准备工作第一步,选择一个编译环境现在Windows系统的主流编译环境有Visual?Studio,Broland?C++?Builder,Dev-C++等,它们都是支持OpenGL的. 我选择Visual?Studio?2010和VC6++作为学习OpenGL的环境.第二步,安装GLUT工具包GLUT不是OpenGL所必须的,但它会给我们的学习带来一定的方便,推荐安装.Windows环境下的GLUT下载地址:(大小约为15

C++读取mat文件 &amp; VS2010 环境配置

1.vs2010的配置 新建一个工程,在属性管理器中选择Debug|Win64->Microsoft.Cpp.Win64.user->VC++目录.设置包含目录为:D:\MATLAB\R2010a\extern\include(我的matlab装在D盘):设置库目录为:D:\MATLAB\R2010a\extern\lib\win32\microsoft. http://blog.sina.com.cn/s/blog_7f18a96b0100tojj.html 2.http://blog.cs

Spring之@Configuration配置解析

1.简单的示例: 1 @Configuration 2 @EnableConfigurationProperties({DemoProperties.class}) 3 public class DemoConfiguration { 4 5 @Bean 6 public Book getBook(){ 7 return new Book(); 8 } 9 } Configuration 1 @Autowired Book book; 2 3 @Test 4 public void testBo

vs2010中配置OpenGL以及针对64位系统所遇问题的解决办法

一.下面将对VS2010中配置OpenGL进行简单介绍. 学习OpenGL前的准备工作 第一步,选择一个编译环境 现在Windows系统的主流编译环境有Visual Studio,Broland C++ Builder,Dev-C++等,它们都是支持OpenGL的. 我选择Visual Studio 2010和VC6++作为学习OpenGL的环境. 第二步,安装GLUT工具包 GLUT不是OpenGL所必须的,但它会给我们的学习带来一定的方便,推荐安装. Windows环境下的GLUT下载地址:

Apache, MySQL, phpMyAdmin在Mac OS X 10.9 下的配置

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Command: mysql_secure_installation +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMEND

VS2010/2012配置优化记录笔记

VS2010/2012配置优化记录笔记 在某些情况下VS2010/2012运行真的实在是太卡了,有什么办法可以提高速度吗?下面介绍几个优化策略,感兴趣的朋友可以参考下,希望可以帮助到你 ? 有的时候VS2010/2012运行真的实在是太卡了,奇卡无比,下面几个技巧可以稍微让你觉得它没那么卡~下面以VS2010来讲 ? VS2010选项视觉体验设置 工具->选项->环境 视觉体验的勾选都去掉.不解释,你懂得.(不过还是建议打开硬件加速) ? 禁用Intellisense 工具->选项-&g