win7+vs2010+VTK

在使用win7和VS2010编译VTK时,可能会遇到LINK链接错误,如 vtkDLG、vtkMDI、vtkSDI、Win32SampleMFC 项目找不到vtkIO.dll。解决方法是手动在项目属性中添加vtkIO.lib到额外依赖项。此外,编译错误C1189提示需要将_WIN32_WINNT至少定义为0x0403,这源于不再支持Windows 95等旧版本。要修复此问题,需要修改所有stdafx.h文件中的WINVER、_WIN32_WINNT等宏定义。

 如果之前Cmake勾选了 build_examples,工程中含有VKT的Examples,在编译过程中,以下四个项目vtkDLG、vtkMDI、vtkSDI、Win32SampleMFC可能还会出现类似下面的LINK链接错误:
error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class...
称找不到vtkIO.dll。对应的解决办法为:
在Solution Explorer中分别找到vtkDLG、vtkMDI、vtkSDI这三个项目,右键—>Properties—>Configuration Properties—>Linker—>Input—>在Additional Dependencies中添加..\..\..\..\..\bin\Debug\vtkIO.lib
另外,再找到Win32SampleMFC这个项目,与以上类似地在Additional Dependencies中添加..\..\..\..\bin\Debug\vtkIO.lib
这样,就为这些项目加入了vtkIO.lib库。

原文:http://www.vislab.cn/bbs/viewthread.php?tid=5773

 

fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x0403

原因:

版本迁移设置的系统最低版本过低

Visual C++ 2010 no longer supports targeting Windows 95, Windows 98, Windows ME, or Windows NT. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros. When you upgrade a project that was created by using an earlier version of Visual C++, you may see compilation errors related to the WINVER or _WIN32_WINNT macros if they are assigned to a version of Windows that is no longer supported(From MSDN)

直接原因-在atlcore.h中有如下三行代码:

#if _WIN32_WINNT < 0x0403

#error This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.

#endif

 

在VTK目录中所有的stdafx.h文件中参照 http://msdn.microsoft.com/en-us/library/aa383745.aspx 修改WINVER,_WIN32_WINNT,_WIN32_WINDOWS和_WIN32_IE的定义,例如:#define WINVER 0x0501

原文:http://www.cnblogs.com/johnzjq/archive/2011/12/14/2287823.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值