Namespace problems when compiling (xutility)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I am trying to compile my project with MTL (Matrix Template Library) and I am
having a lot of problems with a line in the xutility file.

Just including the headers and namespace for the library produces 45 errors.
I have found very little about this on Google, although it appears to be
specific to .NET. I imagine my settings are wrong? Or possibly a bug?

The calling code:

#include <iostream>
#include <mtl/mtl.h>
#include <mtl/matrix.h>
#include <mtl/utils.h>
#include <mtl/linalg_vec.h>
#include "CImg.h"

using namespace std;
using namespace mtl;
using namespace cimg_library;
....

The errors:
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(509): error C2039: 'pointer' : is not a member of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(508): error C2039: 'difference_type' : is not a
member of 'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(514): error C2039: 'difference_type' : is not a
member of 'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(515): error C2039: 'pointer' : is not a member of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(510): error C2039: 'reference' : is not a member of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(516): error C2039: 'reference' : is not a member of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(507): error C2039: 'value_type' : is not a member
of 'std::iterator_traits<int>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(169) : see declaration of
'std::iterator_traits<int>'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(104): error C2065: 'const_iterator' :
undeclared identifier
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(508): error C2065: 'difference_type' : undeclared
identifier
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(102): error C2065: 'iterator' :
undeclared identifier
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(509): error C2065: 'pointer' : undeclared identifier
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\linalg_vec.h(419): error C2065:
'ptr_const_iterator' : undeclared identifier
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\linalg_vec.h(418): error C2065: 'ptr_iterator' :
undeclared identifier
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(510): error C2065: 'reference' : undeclared
identifier
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(507): error C2065: 'value_type' : undeclared
identifier
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\dense2D.h(200): error C2065: 'x' : undeclared
identifier
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(508): error C2146: syntax error : missing ','
before identifier 'difference_type'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(509): error C2146: syntax error : missing ','
before identifier 'pointer'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(510): error C2146: syntax error : missing ','
before identifier 'reference'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(507): error C2146: syntax error : missing ','
before identifier 'value_type'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(136): error C2146: syntax error : missing
';' before identifier 'begin'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(140): error C2146: syntax error : missing
';' before identifier 'begin'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(138): error C2146: syntax error : missing
';' before identifier 'end'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(144): error C2146: syntax error : missing
';' before identifier 'end'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(130): error C2146: syntax error :
missing ';' before identifier 'size_type'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(128): error C2146: syntax error :
missing ';' before identifier 'value_type'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(128): error C2208: 'T1' : no members
defined using this type
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(130): error C2208: 'T2' : no members
defined using this type
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\dense2D.h(201): error C2350:
'mtl::rect_offset<size_t,MM,NN>::__ctor' is not a static member
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(140): error C2433:
'mtl::light1D<T,NN,IND_OFFSET>::const_iterator' : 'inline' not permitted on
data declarations
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(144): error C2433:
'mtl::light1D<T,NN,IND_OFFSET>::const_iterator' : 'inline' not permitted on
data declarations
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(136): error C2433:
'mtl::light1D<T,NN,IND_OFFSET>::iterator' : 'inline' not permitted on data
declarations
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(138): error C2433:
'mtl::light1D<T,NN,IND_OFFSET>::iterator' : 'inline' not permitted on data
declarations
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\dense2D.h(201): error C2433:
'mtl::rect_offset<size_t,MM,NN>::__ctor' : 'inline' not permitted on data
declarations
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(140): error C2501:
'mtl::light1D<T,NN,IND_OFFSET>::const_iterator' : missing storage-class or
type specifiers
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(144): error C2501:
'mtl::light1D<T,NN,IND_OFFSET>::const_iterator' : missing storage-class or
type specifiers
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(136): error C2501:
'mtl::light1D<T,NN,IND_OFFSET>::iterator' : missing storage-class or type
specifiers
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light1D.h(138): error C2501:
'mtl::light1D<T,NN,IND_OFFSET>::iterator' : missing storage-class or type
specifiers
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(130): error C2838: 'size_type' :
illegal qualified name in member declaration
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\light_matrix.h(128): error C2838: 'value_type' :
illegal qualified name in member declaration
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\mtl.h(1046): error C2906:
'mtl::givens_rotation<std::complex<double>>' : explicit specialization
requires 'template <>'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\mtl.h(1155): error C2906:
'mtl::givens_rotation<std::complex<float>>' : explicit specialization
requires 'template <>'
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(510): error C2976: 'std::iterator' : too few
template arguments
c:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(67) : see declaration of 'std::iterator'
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\linalg_vec.h(428): error C3203: 'dense_iterator' :
class template invalid as template argument for template parameter 'Iter',
expected a real type
c:\Documents and Settings\USER\My Documents\C++ Code
Includes\mtl-2.1.2-21\mtl\linalg_vec.h(430): error C3203: 'dense_iterator' :
class template invalid as template argument for template parameter 'Iter',
expected a real type


Most of the files cited are xutility and the library files, which I have no
control over, so I imagine there must be a workaround.

Any ideas?
.



Relevant Pages

  • Type Library import in VC++
    ... I have a problem importing a Microsoft Office type libraries into my ... I am using Visual Studio 2005. ... \wingdi.h: see declaration of 'Rectangle' ... class template can't be used as a template argument for template ...
    (microsoft.public.vc.mfc)
  • Re: errors after upgrading to VS2008
    ... member function already defined or declared ... identifier 'in_avail' ...
    (microsoft.public.vc.language)
  • Re: Shared Objects Libraries and Symbols...
    ... ~ 1 An identifier declared in different scopes or in the same scope more ... There are three kinds of linkage: ... each declaration of an identifier with internal ... ~ 4 For an identifier declared with the storage-class specifier extern ...
    (comp.os.linux.development.apps)
  • Re: Newbie static class member question [C++]
    ... > class declaration, but define them outside of it (as a general ... meaning of an identifier. ... The definition tells the compiler to generate code to allocate memory ... One such namespace is global, ...
    (alt.comp.lang.learn.c-cpp)
  • memory leak detection
    ... identifier not found, even with argument-dependent lookup ... missing ';' before identifier 'm_abFixedBuffer' ... Node::BYTE': missing storage-class or type specifiers ...
    (microsoft.public.vc.atl)