[vtkusers] VTK 4.2 compile error in vtkScalarBarActor

Andrew J. P. Maclean a.maclean at cas.edu.au
Sun Sep 28 20:06:54 EDT 2003


It is a .NET 2003 "feature"! It is relatively easily fixed by casting.
However as .NET 2003 becomes more widely used, this type of issue will
arise more often - so perhaps these should be fixed and entered into the
CVS (mostly they are). It will happen in any product using the pow()
function. For the life on me I can't understand why automatic
type-casting doesn't work here, but in the long run it is safer to
explicitly typecast (particularly with this type of overloading) so ...
I guess it is here to stay.



Andrew



___________________________________________

Andrew J. P. Maclean

Centre for Autonomous Systems
The Rose Street Building J04
The University of Sydney  2006  NSW
AUSTRALIA

Ph: +61 2 9351 3283
Fax: +61 2 9351 7474

URL: http://www.cas.edu.au/
___________________________________________


-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of Ian Miller
Sent: Sunday, 28 September 2003 04:44
To: vtkusers at vtk.org
Subject: Re: [vtkusers] VTK 4.2 compile error in vtkScalarBarActor

Hi,

> On a clean Win2000 os + latest hole patches.
> 1)       full installation of MS Visual Studio.NET 2003
> 2)       installed CMake 1.8 patch 1
> 3)       extracted "VTK-4.2-LatestRelease.tar.gz"
> 4)       ran CMake against VTK 4.2 source code
> 5)       pointed Vis-Studio to the "VTK.sln" file
> 6)       ran Build | Build Solution
> Result:
> Everything compiled except two errors in vtkScalarBarActor:  (lines
357
> and 536) same error:  looking for overloading of 'pow' to (int, float)
> Since pow(float, float) is available, I tried casting the integer
constants
> to float, and compilation errors went away.

Snap!  Except that I'm running Windows XP.

> what pow is doing?

Raising the first argument to the power of the second.

> So how come this hasn't produced failed tests for anyone else?

Maybe the main contributors all use the latest CVS code all the time?
Or they mostly run Linux/UNIX?  I didn't get this problem at work
with Visual C++ 6.0 either, so it's probably just that .NET 2003 is too
recently released for many people to be using it yet.

> Does the (float) casting cause any problems?

Surely not.

Regards,
Ian







More information about the vtkusers mailing list