VS2012 vtk 6.0 32 bit

Hi Experts,

I am desperately trying to get up and running with a hello world vtk window in MFC for VS2012 - I compiled the latest release candidate of vtk (6.0* RC3)...  Does anyone have a basic skeleton project of an SDI interface lying around somewhere?  :o)  Or instructions on how to do so without tearing my hair out?

Many, many thanks!
Mike
LVL 1
threadyAsked:
Who is Participating?
 
threadyConnect With a Mentor Author Commented:
Had some changes needed - here's a note so that everyone can benefit from building on VS2012:

Extracted VTK 5.10.1 to c:\devlib\VTK5.10.1

Used CMake 2 2.8.11.1
VS2012

configure

Checked items:  
BUILD_SHARED_LIBS
VTK_USE_GUI_SUPPORT
VTK_USE_MFC
VTK_USE_RENDERING
VTK_USE_VIDEO_FOR_WINDOWS_
VTK_USE_VIEWS

configure
Generate

Had to modify:
first 3 lines of vtkMFCWindow.cpp to be the following instead of 0x0400:
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 // =_WIN32_WINNT_NT4
#endif

Then VTK builds fine.

Later, to build the samples, create project files in CMake:
src= C:/devlib/VTK5.10.1/Examples/GUI/Win32/vtkMFC
build = C:/devlib/VTK5.10.1/Examples/GUI/Win32/vtkMFC/build

configure

Add the following line to top of CMakeLists.txt:
cmake_minimum_required(VERSION 2.8)

Then for each of the stdafx.h files in the projects (vtkDLG, vtkMDI, vtkSDI), the top of the file should look like this instead (comment out all but _WIN32_WINNT stuff)...
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
//#ifndef WINVER        // Allow use of features specific to Windows 95 and Windows NT 4 or later.
//#define WINVER 0x0501    // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
//#endif

#ifndef _WIN32_WINNT    // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501    // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif          
//
//#if _MSC_VER >= 1300
//#ifndef _WIN32_WINDOWS    // Allow use of features specific to Windows 98 or later.
//#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
//#endif
//#endif
//
//#ifndef _WIN32_IE      // Allow use of features specific to IE 4.0 or later.
//#define _WIN32_IE 0x0400  // Change this to the appropriate value to target IE 5.0 or later.
//#endif

Then there's a missing reference to the vtkIO.lib in each of those projects - just add the reference to linker and build and you're good to go!
0
 
jkrCommented:
>> Does anyone have a basic skeleton project of an SDI interface lying around somewhere?  
>> :o)

You already have it - check out [vtk base dir]\Examples\GUI\Win32\vtkMFC\vtkSDI ;o)
0
 
threadyAuthor Commented:
ok then  :o), let me rephrase the question- that's exactly the one I've been trying to build and it doesn't link.  I get this:   (after referencing every .lib produced in the vtk build)...

2>vtkRenderingFreeTypeOpenGL-6.0.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2019: unresolved external symbol __imp__glBitmap@28 referenced in function "public: virtual void __thiscall vtkOpenGLFreeTypeTextMapper::RenderOverlay(class vtkViewport *,class vtkActor2D *)" (?RenderOverlay@vtkOpenGLFreeTypeTextMapper@@UAEXPAVvtkViewport@@PAVvtkActor2D@@@Z)
2>vtkftgl-6.0.lib(FTPixmapGlyphRenderOpenGL.obj) : error LNK2001: unresolved external symbol __imp__glBitmap@28
2>vtkRenderingFreeTypeOpenGL-6.0.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2019: unresolved external symbol __imp__glColor4ub@16 referenced in function "public: virtual void __thiscall vtkOpenGLFreeTypeTextMapper::RenderOverlay(class vtkViewport *,class vtkActor2D *)" (?RenderOverlay@vtkOpenGLFreeTypeTextMapper@@UAEXPAVvtkViewport@@PAVvtkActor2D@@@Z)
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLGlyph3DMapper.obj) : error LNK2001: unresolved external symbol __imp__glColor4ub@16
2>vtkRenderingFreeTypeOpenGL-6.0.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2019: unresolved external symbol __imp__glDepthFunc@4 referenced in function "public: virtual void __thiscall vtkOpenGLFreeTypeTextMapper::RenderOverlay(class vtkViewport *,class vtkActor2D *)" (?RenderOverlay@vtkOpenGLFreeTypeTextMapper@@UAEXPAVvtkViewport@@PAVvtkActor2D@@@Z)
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderer.obj) : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderWindow.obj) : error LNK2001: unresolved external symbol __imp__glDepthFunc@4
2>vtkftgl-6.0.lib(FTGLPixmapFontRenderOpenGL.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLTexture.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLImageMapper.obj) : error LNK2019: unresolved external symbol __imp__glDisable@4 referenced in function "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall std::_System_error_category::message(int)const " (?message@_System_error_category@std@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@H@Z)
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLPolyDataMapper2D.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderWindow.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLProperty.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderer.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRepresentationPainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLScalarsToColorsPainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLCompositePainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLImageSliceMapper.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLLightingPainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLPainterDeviceAdapter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingFreeTypeOpenGL-6.0.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkWin32OpenGLRenderWindow.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLClipPlanesPainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLCoincidentTopologyResolutionPainter.obj) : error LNK2001: unresolved external symbol __imp__glDisable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLImageMapper.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLPolyDataMapper2D.obj) : error LNK2019: unresolved external symbol __imp__glEnable@4 referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > & __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::assign(char const *)" (?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBD@Z)
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderWindow.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
2>vtkftgl-6.0.lib(FTGLPixmapFontRenderOpenGL.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
2>vtkRenderingOpenGL-6.0.lib(vtkOpenGLRenderer.obj) : error LNK2001: unresolved external symbol __imp__glEnable@4
0
 
jkrCommented:
Seems that OpenGL.lib is missing - at least the names of the unresoved functions suggests that.
0
 
threadyAuthor Commented:
It's the solution.
0
All Courses

From novice to tech pro — start learning today.