Solved

VS2012 vtk 6.0 32 bit

Posted on 2013-06-19
5
869 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

717 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