[vtkusers] Compilation problem using Visual Studio .NET 2003 ...

Charles Boivin Charles.Boivin at rwdiwest.com
Fri Jul 16 11:02:46 EDT 2004


Hello everyone,

I am in the process of evaluating VTK for the visualization of results
from our CFD solver. Last week, I downloaded the binary distribution of
VTK 4.2 (for Windows) and installed it. I then tried to make one of the
MFC examples work, and I succeeded after a few changes were made to the
code. (The example is the SDI MFC application in the examples
directory).

This week, I have been trying to *compile* VTK from the source code; I
suspect I will need to do this for our application so I want to get it
going right away. I have CMake 1.6 and VTK 4.2, both taken from the CDs
that came with the book (which we have since obtained). 

I had a few problems with CMake to start with... It seems that whenever
I select "Visual Studio 7" as the project type, CMake invariable can't
find itself! And even if I specify the directory for CMake, the process
then fails with some compilation error -- it does not generate any of
the VS 2003 project files. 

I had some success selecting "Visual Studio 6" as the project type, and
then importing those in VS.NET -- they were automatically converted.
After adding the "VTK_USE_ANSI_STDLIB" define in the project properties,
I was able to compile the library. I also generated all the test and
examples, and all the tests were successful. I compiled the library in
static mode (for now, at least).

I then tried to link the SDI MFC example to the library I had just
compiled, and ran into some problems:
I get a lot of linking errors, most of them looking like they are
caused by perhaps a missing OpenGL library? Here is an example:

....
vtkRendering.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2019:
unresolved external symbol __imp__glBitmap at 28 referenced in function
"public: virtual void __thiscall
vtkOpenGLFreeTypeTextMapper::RenderOverlay(class vtkViewport *,class
vtkActor2D *)"
(?RenderOverlay at vtkOpenGLFreeTypeTextMapper@@UAEXPAVvtkViewport@@PAVvtkActor2D@@@Z)
vtkftgl.lib(FTBitmapGlyphRenderOpenGL.obj) : error LNK2001: unresolved
external symbol __imp__glBitmap at 28
vtkftgl.lib(FTPixmapGlyphRenderOpenGL.obj) : error LNK2001: unresolved
external symbol __imp__glBitmap at 28
vtkRendering.lib(vtkOpenGLFreeTypeTextMapper.obj) : error LNK2019:
unresolved external symbol __imp__glRasterPos2i at 8 referenced in function
"public: virtual void __thiscall
vtkOpenGLFreeTypeTextMapper::RenderOverlay(class vtkViewport *,class
vtkActor2D *)"
(?RenderOverlay at vtkOpenGLFreeTypeTextMapper@@UAEXPAVvtkViewport@@PAVvtkActor2D@@@Z)
....

... and so on.

How could I solve this? I know I could go back to the pre-compiled
binaries for now to make everything work, but I would like to solve this
problem... It looks like it has to with OpenGL, but I frankly do not
have a clue as to what I should do at this point.

Any help would be appreciated!

Thank you in advance,

Charles Boivin



More information about the vtkusers mailing list