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
Solved

VS2012 vtk 6.0 32 bit

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 clear a vector as well as how to detect empty vectors in C++.

792 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