Solved

VS2012 vtk 6.0 32 bit

Posted on 2013-06-19
5
846 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

863 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

21 Experts available now in Live!

Get 1:1 Help Now