如果之前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