I have been stuck with a MFC-related problem for quite some time now. I have read through many forums, VTK-Users posts, etc. without any luck.
My basic problem is that vtkMFC.lib is not getting built; no matter how I build my project or configure it.
These are the steps I have followed:
- Generate VTK.sln using CMake 2.8.9 with VTK_USE_GUISUPPORT, BUILD_SHARED_LIBS, VTK_USE_MFC, BUILD_EXAMPLES turned ON and VTK_USE_VIDEO_FOR_WINDOWS turned OFF.
- Open VTK.sln on VS-2008 and build ONLY vtkMFC.sln.
- Build entire solution. {I have also tried with points 2 and 3 inter-changed with no result}
- There are 6 erros; of which 3 are to do with the fact that vtkMFC.lib isn't there (for the examples. obviously). The rest are regarding a couple of resolved external symbols,
error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkDataSetReader * _cdecl vtkDataSetReader::New(void)" (_imp_?New@vtkDataSetReader@@SAPAV1@XZ) referenced in function "protected: __thiscall CSampleDoc::CSampleDoc(void)" (??0CSampleDoc@@IAE@XZ) in SampleDoc.obj
error LNK2019: unresolved external symbol "__declspec(dllimport) public: class vtkDataSet * _thiscall vtkDataSetReader::GetOutput(void)" (_imp_?GetOutput@vtkDataSetReader@@QAEPAVvtkDataSet@@XZ) referenced in function "public: virtual int __thiscall CSampleDoc::OnOpenDocument(char const *)" (?OnOpenDocument@CSampleDoc@@UAEHPBD@Z) in SampleDoc.obj
The files generated in Debug/bin for vtkMFC solution are vtkMFC.dll, vtkMFC.idb, vtkMFC.ilk, vtkMFC.pdb.
I have also added vtkIO.lib to the projects that generated the error and the same erros continue along with another which says that vtkIO.lib isn't found.
Any help in this regard would be much appreciated.
Best, Sarthak