[vtkusers] MFC app in VS .NET 2003

Kent Ogden OgdenK at upstate.edu
Thu Dec 22 16:39:40 EST 2005


Hi all,

I am brand new to using vtk, I would like to add vtk capabilities to an
existing MFC app created in VS .NET 2003.  I am starting by trying to build
the simplest of MFC apps, but without success.  I perused the mailing list
archive but couldn't find an answer for my problems.  What I have done so
far:

Downloaded VTK-4.4-LatestRelease.zip, unzipped to C:\VTK
Used CMake 2.2 to create the .Net 2003 solution (including building the
dll's)
Open the solution, built ALL_BUILD, no errors (about 15 minutes on my
machine)
Moved the created dll's into Windows/System32

In VS .NET:

Added all the directories for the includes in the
Tools/Options/Projects/VC++ Directories (C:\vtk, C:\vtk\common, etc. etc.)
Did the same for the lib files (C:\vtk\bin\debug)  
(Should I have built as the release version instead of Debug?)

Then built a simple SDI MFC app called testvtk, put a button on the
interface, and tried to add the code from the cone.cxx file in the
testvtkView.cpp to get the cone to display with a button push.  The header
files are all found just fine, but I get many (>100) errors in files
provided in MSVC .NET ?!?!  These seem to be related to IO and utilities,
some examples of where the errors occur:

c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(862): error C2143: syntax error : missing ';'
before '<'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\streambuf(320): error C2146: syntax error : missing ';'
before identifier 'xsputn'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xstring(1564): error C2947: expecting '>' to terminate
template-argument-list, found '>'

etc. etc. ad infinitum (ok more than 100 at which point it terminates). 
These are related to the #includes from the cone.cxx file, the errors appear
when the includes are put into the testvtkView.cpp file.

Is there a setting I need to change that will prevent this?  None of the
errors seem to be in any vtk files, but in MS files that they are
referencing.  Any help would be greatly appreciated . .


Kent


Kent Ogden PhD
Assistant Professor, Radiology
SUNY Upstate Medical University
750 E. Adams Street
Syracuse, NY  13210

email:  ogdenk at upstate.edu 
voice:  (315) 464-5083
fax:       (315) 464-5095



More information about the vtkusers mailing list