[vtkusers] New: Recipe for building VTK-5.8.0 with C++ Builder XE (bcc32 6.31)

Oliver Weinheimer mail at oliwe.com
Wed Dec 7 08:48:12 EST 2011


Recipe for building VTK-5.8.0 with C++ Builder XE (bcc32 6.31)
(Tested on Win 7)

[A] Download vtk-5.8.0.zip

[B] Download and installation of cmake 2.8.6

[c] Changes in Windows-Borland.cmake (Program Files (x86)\CMake
2.8\share\cmake-2.8\Modules\Platform) 

(a) replace -tW<something> with -t<something> in the whole file
(b) replace set(_RTLDLL "-tR") with set(_RTLDLL "-tR-") in line 35


[D] Running CMake 
	Changing Options:
	- CMake_Build_Type Release (Debug failed, aditional code changes have to be
done)
	- I did not test 'Shared Lib'

->

Output of CMAKE: 
---------------------------------------------------------------
Function 'gettimeofday()' was not found. HDF5 will use its
  own implementation.. This can happen on older versions of
  MinGW on Windows. Consider upgrading your MinGW installation
  to a newer version such as MinGW 3.12
---------------------------------------------------------------
Filter ZLIB is ON
Configuring done
	
[E] Open cmd.exe in Vtk binaries directory and type in "make"

[F] Compilation and linking: Fix Errors

a)
Error E2450 E:\Kitware\vtk-5.8.0-source-bcc\Utilities\vtkhdf5\src\H5FDcore.c
420: Undefined structur
e '_stati64' in function H5FD_core_open

-> change in H5win32defs.h

typedef struct _stati64     h5_stat_t;
changed to
typedef struct stati64     h5_stat_t;


b)
Commenting out lines 224-226 in H5Omtime.
//#elif defined(H5_HAVE_TIMEZONE)
//    /* Linux libc-5 */
//    the_time -= timezone - (tm.tm_isdst?3600:0);

c) 
H5FDwindows.c line 329

struct _stati64 sb;
changed to
struct stati64 sb;

d)
Embarcadero C++ 6.31 for Win32 Copyright (c) 1993-2010 Embarcadero
Technologies, Inc.
E:\Kitware\vtk-5.6.1\Utilities\vtknetcdf\attr.c:
Error E2176 E:\Kitware\vtk-5.6.1\Utilities\vtknetcdf\utf8proc.h 70: Too many
types in declaration
Error E2146 E:\Kitware\vtk-5.6.1\Utilities\vtknetcdf\utf8proc.h 70: Need an
identifier to declare

-> add to utf8proc.h
#define HAVE__BOOL 

(because XE was shipped without stdbool.h, but bool is defined elsewhere) 

e)
E:\Kitware\vtk-5.6.1\Utilities\vtknetcdf\posixio.c:
Error E2209 E:\Kitware\vtk-5.6.1\Utilities\vtknetcdf\posixio.c 21: Unable to
open include file 'unistd.h'

#ifdef _MSC_VER 
changed to 
#ifdef __BORLANDC__
in line 18

f)
vtkExtractSelectedIds.cxx

E:\Kitware\vtk-5.8.0-source-bcc\Graphics\vtkExtractSelectedIds.cxx:
Fatal F1004
E:\Kitware\vtk-5.8.0-source-bcc\Graphics\vtkExtractSelectedIds.cxx 509:
Internal compile
r error at 0x46c957 with base 0x400000 in function
vtkExtractSelectedIds::ExtractCells(vtkSelectionN
ode *,vtkDataSet *,vtkDataSet *)
Fatal F1004
E:\Kitware\vtk-5.8.0-source-bcc\Graphics\vtkExtractSelectedIds.cxx 509:
Internal compile
r error  in function vtkExtractSelectedIds::ExtractCells(vtkSelectionNode
*,vtkDataSet *,vtkDataSet
*)

all lines with
static_cast<VTK_TT1>((static_cast<VTK_TT2*>(labelVoid)[labelArrayIndex])));
changed to
static_cast<VTK_TT1*>(labelVoid)[labelArrayIndex]);

(not sure if this is semantically correct, but it compiles)

g)
vtkYoungsMaterialInterface.cxx
#ifdef __BCPLUSPLUS__
#include <malloc.h>
#endif
at line 51

(forum entry of Alessandro Martini)

h)
Fatal F1008 E:\Kitware\vtk-5.6.1\IO\vtkFLUENTReader.cxx 2346: Out of memory
in function vtkFLUENTRea
der::LoadVariableNames()

I excluded (because i never needed this classes until now: 
vtkFLUENTReader.cxx
vtkOpenFOAMReader.cxx

i)
Added
#include <ctype.h>
to
\Kitware\VTK-5.6.0\IO\vtkArrayReader.cxx

because isspace was not found

j)
I excluded (because i never needed this classes until now: 
vtPlotBar.cxx
vtkPlotStacked.cxx

k)
last line in cmd:
[100%] Built target vtkCharts 
-> :-)

[G]
[Building vtkBorlandRenderWindowPkg.bpk in C++ Builder XE IDE

Set system variables VTK_SOURCE and VTK_BIN

Open C++ Builder IDE

New Package

Add to Project vtkBorlandRenderWindowPkg.cpp 

Add to Include Path in C++ Builder IDE 
$(VTK_SOURCE)\Common
$(VTK_SOURCE)\Rendering
$(VTK_SOURCE)\Filtering
$(VTK_BIN)
$(VTK_BIN)\Rendering

#include <vcl\Sysutils.hpp>
changed to 
#include <Sysutils.hpp>
in vtkBorlandRenderWindow.cpp

Add to Project VTK-libs
vtkCommon.lib
vtksys.lib
vtkRendering.lib 
vtkFiltering.lib
vtkGraphics.lib
vtkIO.lib

Make Project

Component->Install Packages Add vtkBorlandRenderWindowPkg.bpl

--
View this message in context: http://vtk.1045678.n5.nabble.com/Recipe-for-building-VTK-5-6-1-with-C-Builder-XE-bcc32-6-31-tp3337807p5055692.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list