[Liblas-devel] Visual Studio 2010 error

Mateusz Loskot mateusz at loskot.net
Tue Jan 26 08:27:58 EST 2010


esteban70 at libero.it wrote:
> Hello,
> 
> I'm using Visual Studio 2010 Beta 2 and the latest version on liblas.
> 
> Using "#include <liblas/lasreader.hpp>" cause this error:
> 
> utility.hpp(253): error C2589: '(' : illegal token on right side of '::'
> 
> at the line
> 
> T const rmin = std::numeric_limits<T>::min();
> 
> I'm a C++ newby so i wasn't able to figure where the error is. Any help?

The problem is that you are probably compiling your program
in presence of min() nad max() macros which often Windows pollutes with.
These macros cause plenty of headache.

In order to solve this kind of problems by disabling C++ argument
dependant lookup feature with extra brackets:

For the time being, apply this fix:

std::numeric_limits<T>::min();

with

(std::numeric_limits<T>::min)();

This fix should solve similar problems with

std::numeric_limits<T>::max();
to
(std::numeric_limits<T>::max)();

as well as with

std::min(v) -> (std::min)(v)
std::max(v) -> (std::max)(v)

I will commit these fixes to libLAS code later tonight.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the Liblas-devel mailing list