On Thursday, August 23, 2012 3:22:04 PM UTC+2, TP wrote:
>
> On Wed, Aug 22, 2012 at 11:58 PM, Davor Pleskina 
> <[email protected]> wrote: 
> > I still think the problem is template definition and not postion of 
> files 
> > (error is allheaders.h file - just one line; when commented out source 
> > builds but probably leaves space for unexpected behavior...). 
>
>  
Now I understand what my coworker meant by "being optimistic about getting 
help via forums". :-S

Even if I screw up the point is not to prove that I screwed up (I can guess 
so myself) but to find possible showstopper.

Actually I downloaded leptonica (as NOT stated in documentation), and 
changed folder structure slightly because I think forcing folder structure 
within some others development environment is egoistic and simply 
senseless. Yet, after first advice I reorganized folders but am of course 
(expected) getting the same error. And for that specific line in one 
specific file only. Other files compile just fine.

Here:

1>..\..\..\include\leptonica\allheaders.h(1199) : error C2955: 
'std::allocator' : use of class template requires template argument list
1>        C:\Program Files\Microsoft Visual Studio 
9.0\VC\include\xmemory(90) : see declaration of 'std::allocator'
1>..\..\..\include\leptonica\*allheaders.h(1199) *: warning C4190: 
'abstract declarator' has C-linkage specified, but returns UDT 
'std::allocator' which is incompatible with C
1>        C:\Program Files\Microsoft Visual Studio 9.0\VC\include\*xmemory*(90) 
: see declaration of 'std::allocator'

Code line in allheaders.h is:
LEPT_DLL extern void setPixMemoryManager ( void * ( allocator ( size_t ) ), 
void  ( deallocator ( void * ) ) );

and the DEFINITION it complains about is in above mentioned xmemory, 
looking like this:

// TEMPLATE CLASS _Allocator_base
template<class _Ty>
struct _Allocator_base
{ // base class for generic allocators
typedef _Ty value_type;
};

// TEMPLATE CLASS _Allocator_base<const _Ty>
template<class _Ty>
struct _Allocator_base<const _Ty>
{ // base class for generic allocators for const _Ty
typedef _Ty value_type;
};

// TEMPLATE CLASS allocator
template<class _Ty>
class allocator
: public _Allocator_base<_Ty>
{ // generic allocator for objects of class _Ty
public:
typedef _Allocator_base<_Ty> _Mybase;
typedef typename _Mybase::value_type value_type;
typedef value_type _FARQ *pointer;
typedef value_type _FARQ& reference;
typedef const value_type _FARQ *const_pointer;
typedef const value_type _FARQ& const_reference;

typedef _SIZT size_type;
typedef _PDFT difference_type;

template<class _Other>
struct rebind
{ // convert an allocator<_Ty> to an allocator <_Other>
typedef allocator<_Other> other;
};

pointer address(reference _Val) const
{ // return address of mutable _Val
return (&_Val);
}

const_pointer address(const_reference _Val) const
{ // return address of nonmutable _Val
return (&_Val);
}

allocator() _THROW0()
{ // construct default allocator (do nothing)
}

allocator(const allocator<_Ty>&) _THROW0()
{ // construct by copying (do nothing)
}

template<class _Other>
allocator(const allocator<_Other>&) _THROW0()
{ // construct from a related allocator (do nothing)
}

template<class _Other>
allocator<_Ty>& operator=(const allocator<_Other>&)
{ // assign from a related allocator (do nothing)
return (*this);
}

void deallocate(pointer _Ptr, size_type)
{ // deallocate object at _Ptr, ignore size
::operator delete(_Ptr);
}

pointer allocate(size_type _Count)
{ // allocate array of _Count elements
return (_Allocate(_Count, (pointer)0));
}

pointer allocate(size_type _Count, const void _FARQ *)
{ // allocate array of _Count elements, ignore hint
return (allocate(_Count));
}

void construct(pointer _Ptr, const _Ty& _Val)
{ // construct object at _Ptr with value _Val
_Construct(_Ptr, _Val);
}

void destroy(pointer _Ptr)
{ // destroy object at _Ptr
_Destroy(_Ptr);
}

_SIZT max_size() const _THROW0()
{ // estimate maximum array size
_SIZT _Count = (_SIZT)(-1) / sizeof (_Ty);
return (0 < _Count ? _Count : 1);
}
};

Now that is where my C++ knowledge fails, hardly in setting up folder 
structure.

So once again thanks in advance for any (helpful) help! :-)

Regards,
Davor

-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

Reply via email to