vtk2.4 and visual c++6.0? -> Compiling into static library.

Giling, Erwin Giling at TPD.TNO.NL
Mon Oct 18 04:43:34 EDT 1999


Dear Tristan, 

Last week I also just started with vtk2.4 + MVC6.0. I wanted to use a static
library. Therefore I decided not to use the "portable" distribution with the
makefile generator.

I did not need TCL / Java / Phyton yet, so these files were excluded (see
below for list). It is easy to add them later though.

I never look at source files directly, I only use the Visual Studio class
browser so you can quickly jump to classes, use browse info to look up
variables and methods, see the inheritances, base classes etc etc. Therefore
I just collected all the source files and put them in one directory.

So what I did was:

1 - Generate a new static library *.lib project named "libvtk" in Visual
Studio. I used MFC and precompiled headers options.
2 - Grab all vtk source and header files and copy them to the new libvtk
directory (see below for exclusions for X/Phyton/TCL/etc..). This makes a
nice mess of all vtk files in one place, but you will not look at them
anyway because of the class browser.
3 - Modify the vtkWin32Header.h header file so it will compile for a static
library, make sure that the line:
  #define VTK_EXPORT __declspec( dllimport ) 
is commented out, and just add the empty define:
  #define VTK_EXPORT 
in the proper place (note that VTKDLL will not be defined in our project)
4 - Add all files to the project in the proper places in FileView.
5 - in the debug project settings, check "generate browse info".
6 - in the precompiled headers section, use "automatic".
7 - (batch-)build the libraries, release and debug versions (takes some
time)

To compile the sample applications, you will have to make sure that the
header files in your new libvtk directory are included, and the new static
library is linked. Also, in the link settings of your applications, you may
want to add in Object/Library modules:

  ..\libvtk\debug\libvtk.lib opengl32.lib glu32.lib glaux.lib 

or "release" for the release version.


This approach worked fine for me. In the above description I may have
forgotten some details, but I hope the idea is clear and my first posting to
this list is useful for others too!


All the best,


E r w i n   G i l i n g


==============================================
TNO Institute of Applied Physics (TNO-TPD)
Instrumentation Division
Inspection Technology Department
PO Box 155
2600 AD Delft - The Netherlands
tel   : +31 15 2692301
fax   : +31 15 2692111
email : giling at tpd.tno.nl
WWW   : http://www.tpd.tno.nl  (TNO-TPD)
        http://www.tno.nl/homepage.html (TNO main menu)



==============================================================
vtk 2.4 "X-files": Exclusion list of files that will not compile under WIN32
because of TCL, Java, X, Unix etc. related code (I don't need them!):


 Directory of D:\vtksource\libvtk\X-files

13-10-99  14:03         <DIR>          .
13-10-99  14:03         <DIR>          ..
07-11-96  10:03                  1,920 vtkJavaPanel.cxx
13-07-99  17:19                 14,494 vtkJavaUtil.cxx
13-07-99  17:00                  3,806 vtkJavaUtil.h
13-05-99  09:19                 17,476 vtkOpenGLImageWindow.cxx
23-04-99  08:57                  4,793 vtkOpenGLImageWindow.h
04-06-99  15:56                 26,997 vtkOpenGLRenderWindow.cxx
29-04-99  13:51                  5,945 vtkOpenGLRenderWindow.h
16-06-99  16:10                  4,974 vtkOpenGLVolumeProVG500Mapper.cxx
16-06-99  16:10                  5,129 vtkOpenGLVolumeProVG500Mapper.h
02-11-98  12:31                  7,123 vtkPythonUtil.cxx
02-11-98  12:31                  2,548 vtkPythonUtil.h
01-05-99  08:45                 14,828 vtkTclUtil.cxx
29-04-99  21:39                  3,892 vtkTclUtil.h
30-06-99  13:55                 19,055 vtkTextSource.cxx
21-06-99  10:07                  4,191 vtkTextSource.h
25-03-99  16:50                 25,511 vtkTkImageViewerWidget.cxx
25-03-99  16:50                  3,323 vtkTkImageViewerWidget.h
08-04-99  16:16                 23,771 vtkTkImageWindowWidget.cxx
25-03-99  16:50                  3,321 vtkTkImageWindowWidget.h
28-05-99  13:26                 27,107 vtkTkRenderWidget.cxx
25-03-99  16:49                  3,434 vtkTkRenderWidget.h
18-06-99  11:54                 30,463 vtkVolumeProMapper.cxx
16-06-99  16:10                 13,727 vtkVolumeProMapper.h
16-06-99  16:10                  2,735 vtkVolumeProVG500Mapper.cxx
16-06-99  16:10                  4,742 vtkVolumeProVG500Mapper.h
18-06-99  13:18                 23,548 vtkXImageMapper.cxx
30-04-99  10:59                  4,297 vtkXImageMapper.h
23-04-99  08:57                 28,686 vtkXImageWindow.cxx
23-04-99  08:57                  6,858 vtkXImageWindow.h
02-04-99  08:19                  8,194 vtkXOpenGLTextMapper.cxx
09-03-99  16:15                  3,458 vtkXOpenGLTextMapper.h
11-03-99  12:39                  7,693 vtkXPolyDataMapper2D.cxx
11-03-99  12:39                  2,911 vtkXPolyDataMapper2D.h
22-02-99  09:16                  9,294 vtkXRenderWindow.cxx
23-04-99  09:01                  5,570 vtkXRenderWindow.h
31-05-99  12:34                 33,653 vtkXRenderWindowInteractor.cxx
31-05-99  12:34                  8,971 vtkXRenderWindowInteractor.h
20-05-99  10:50                 28,834 vtkXRenderWindowTclInteractor.cxx
12-05-99  10:50                  8,639 vtkXRenderWindowTclInteractor.h
16-04-99  11:21                  9,694 vtkXTextMapper.cxx
02-04-99  08:19                  3,400 vtkXTextMapper.h
              43 File(s)        469,005 bytes


-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list