[Insight-users] Compiling errors

Marco Di Lorenzo dilorenzo.marco@inwind.it
Wed, 30 Oct 2002 18:23:58 +0100


Hi everybody,

I'm a total newbie about Itk, and I didn't manage to get it compiled
properly yet.
I downloaded the Beta2 sources for Windows, but when I try to compile the
Cmake-generated projects (I use Visual C++ .NET), I get seven or eight times
a strange error:


e:\Dev\Itk\InsightBeta2\Code\Common\itk_alloc.h(40) : error C2660:
'std::allocator::allocate' : function does not take 2 parameters
        e:\Dev\Itk\InsightBeta2\Code\Common\itk_alloc.h(40) : while
compiling class-template member function 'itk_simple_alloc::value_type
*itk_simple_alloc::allocate(void)'
        with
        [
            T=itk::hashtable_base,std::allocator>::node,
            Alloc=std::allocator
        ]
        e:\Dev\Itk\InsightBeta2\Code\Common\itk_hashtable.h(296) : see
reference to class template instantiation 'itk_simple_alloc' being compiled
        with
        [
            T=itk::hashtable_base,std::allocator>::node,
            Alloc=std::allocator
        ]
        e:\Dev\Itk\InsightBeta2\Code\Common\itk_hashtable.h(295) : while
compiling class-template member function 'itk::hashtable_base::node
*itk::hashtable_base::new_node(const itk::hashtable_base::value_type &)'
        with
        [
            Value=std::pair,
            Alloc=std::allocator
        ]
        e:\Dev\Itk\InsightBeta2\Code\Common\itk_hashtable.h(332) : see
reference to class template instantiation 'itk::hashtable_base' being
compiled
        with
        [
            Value=std::pair,
            Alloc=std::allocator
        ]




The odd thing is that just two lines above the line (40), there is (more or
less) the same code but it doesn't produce any error!
Here is it (from itk_alloc.h):

(37) static value_type *allocate(size_t n)
(38) { return 0 == n? 0 : (value_type*) alloc_type().allocate(n * chunk,
0); }
(39) static value_type *allocate(void)
(40) { return (value_type*) alloc_type().allocate(chunk, 0); }

Any help will be much appreciated!
Thank you in advance,
Marco