|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
MTL: MTL and Visual Studio 2008 (Express Edition)Hi
I am currently trying to move some C++ code from Linux to Windows; the code uses MTL for all of the linear algebra. As a first test, I have tried to use MS Visual Studio 2008 (express edition) to run the simple example given at:
However, I end up with 54 error messages and 11 warnings, all of which seem to stem from the header file 'light_matrix.h'. Please find below the test, together with the error messages. Any help would be appreciated, Anthony. **************************** test ****************************// 02Jan09
// Taken from: http://www.osl.iu.edu/research/mtl/examples/euclid_norm.cc // -*- c++ -*- // // $COPYRIGHT$ // //=========================================================================== /* #include "mtl/mtl.h"
#include "mtl/utils.h" #include "mtl/linalg_vec.h" */ #include <mtl/mtl.h> #include <mtl/utils.h> #include <mtl/linalg_vec.h>
/* Sample output; X: [1,5,3,1,] The L-2 norm of X is 6 */ using namespace mtl; using namespace std;
typedef external_vec<double> Vec; int main() { double data[] = {1,5,3,1}; Vec x(data, 4); double s = two_norm(x);
cout << "X: "; print_vector(x); cout << "The L-2 norm of X is " << s << endl; return 0;
} **************************** error messages ****************************Compiling... euclid_norm.cpp
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' : dependent name is not a type prefix with 'typename' to indicate a type
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(177) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>' being compiled
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(106) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned' being compiled
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(414) : see reference to class template instantiation 'mtl::light_matrix<T,SizeType,Orien,Strided>' being compiled
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::value_type' should be preceded by ';'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(128) : error C2208: 'T' : no members defined using this type c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : dependent name is not a type
prefix with 'typename' to indicate a type c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' should be preceded by ';'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(111) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(129) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::pointer' : illegal syntax for using-declaration; expected qualified-name
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' : dependent name is not a type prefix with 'typename' to indicate a type
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::size_type' should be preceded by ';'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : error C2208: 'SizeType' : no members defined using this type c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : dependent name is not a type
prefix with 'typename' to indicate a type c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2144: syntax error : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' should be preceded by ';'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(113) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(131) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::difference_type' : illegal syntax for using-declaration; expected qualified-name
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' : dependent name is not a type
prefix with 'typename' to indicate a type c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::const_reference' is not a valid template type argument for parameter 'A'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : warning C4346: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : dependent name is not a type prefix with 'typename' to indicate a type
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2923: 'mtl::IF' : 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a valid template type argument for parameter 'B'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2146: syntax error : missing ';' before identifier 'reference' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2602: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' is not a member of a base class of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(108) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(133) : error C2868: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::reference' : illegal syntax for using-declaration; expected qualified-name
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(137) : error C2061: syntax error : identifier 'size_type' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2061: syntax error : identifier 'size_type'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2805: binary 'operator +=' has too few parameters c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(154) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator +=' : error in function declaration; skipping function body
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2061: syntax error : identifier 'size_type' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2805: binary 'operator -=' has too few parameters
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(159) : error C2333: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator -=' : error in function declaration; skipping function body
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2146: syntax error : missing ';' before identifier 'index' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(165) : warning C4183: 'index': missing return type; assumed to be a member function returning 'int' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2143: syntax error : missing ';' before '&'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(167) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2143: syntax error : missing ';' before '&' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C2086: 'oned::oned::size_type size_type' : redefinition c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(130) : see declaration of 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::operator size_type'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(168) : warning C4183: 'pos': missing return type; assumed to be a member function returning 'int'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2146: syntax error : missing ';' before identifier 'row' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(170) : warning C4183: 'row': missing return type; assumed to be a member function returning 'int' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2146: syntax error : missing ';' before identifier 'column'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C2433: 'mtl::light_matrix<T,SizeType,Orien,Strided>::oned::__iterator<isConst>::size_type' : 'inline' not permitted on data declarations
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(171) : warning C4183: 'column': missing return type; assumed to be a member function returning 'int' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C2146: syntax error : missing ';' before identifier 'i'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(174) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C2146: syntax error : missing ';' before identifier 'offset'
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(175) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C2146: syntax error : missing ';' before identifier 'stride' c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\matrix template library\mtl-2.1.2-21\mtl\light_matrix.h(176) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int Build log was saved at "file://c:\Documents and Settings\Anthony\My Documents\Visual Studio 2008\Projects\MTL_Test\MTL_Test\Debug\BuildLog.htm"
MTL_Test - 54 error(s), 11 warning(s) ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== _______________________________________________ This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/ |
| Free embeddable forum powered by Nabble | Forum Help |