Solved

VS2012 vtk 6.0 32 bit

Posted on 2013-06-19
5
839 Views
Last Modified: 2013-06-26
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
0
Comment
Question by:thready
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 39263191
>> 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
 
LVL 1

Author Comment

by:thready
ID: 39263274
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
 
LVL 86

Expert Comment

by:jkr
ID: 39263420
Seems that OpenGL.lib is missing - at least the names of the unresoved functions suggests that.
0
 
LVL 1

Accepted Solution

by:
thready earned 0 total points
ID: 39266824
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
 
LVL 1

Author Closing Comment

by:thready
ID: 39277402
It's the solution.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now