compilation error with c++ 11

469 views
Skip to first unread message

flyd...@gmail.com

unread,
Dec 1, 2015, 4:16:32 AM12/1/15
to kaldi-help
I'm using a old version of kaldi. Recently, I update my GPU card and plan to use CUDA-7.0. So I update the gcc version form 4.5.2 to 4.9. Then I come cross the errors:


g++ -msse -msse2 -Wall -I.. -DKALDI_DOUBLEPRECISION=0 -DHAVE_POSIX_MEMALIGN -Wno-sign-compare -Winit-self -DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H -DHAVE_ATLAS -I/usr/local/atlas3.10.0/include -I/usr/local/openfst-1.3.2/include  -g  -DHAVE_CUDA -I/usr/local/cuda//include -c -fpermissive -o kaldi-matrix.o kaldi-matrix.cc
In file included from kaldi-matrix.cc:21:0:
../matrix/kaldi-matrix.h: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::SpMatrix<OtherReal>&) [with OtherReal = float; Real = float]’:
kaldi-matrix.cc:249:23:   required from here
../matrix/kaldi-matrix.h:543:17: 警告:‘CopyFromSp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromSp(M);
                 ^
../matrix/kaldi-matrix.h:543:17: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:543:17: 附注:use ‘this->CopyFromSp’ instead
../matrix/kaldi-matrix.h: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::SpMatrix<OtherReal>&) [with OtherReal = double; Real = double]’:
kaldi-matrix.cc:265:24:   required from here
../matrix/kaldi-matrix.h:543:17: 警告:‘CopyFromSp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
../matrix/kaldi-matrix.h:543:17: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:543:17: 附注:use ‘this->CopyFromSp’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::MatrixBase<OtherReal>&, kaldi::MatrixTransposeType) [with OtherReal = double; Real = float]’:
kaldi-matrix.cc:581:48:   required from here
kaldi-matrix.cc:571:18: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M);
                  ^
kaldi-matrix.cc:571:18: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:571:18: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc:574:26: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M, kTrans);
                          ^
kaldi-matrix.cc:574:26: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:574:26: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::MatrixBase<OtherReal>&, kaldi::MatrixTransposeType) [with OtherReal = float; Real = double]’:
kaldi-matrix.cc:584:49:   required from here
kaldi-matrix.cc:571:18: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M);
                  ^
kaldi-matrix.cc:571:18: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:571:18: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc:574:26: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M, kTrans);
                          ^
kaldi-matrix.cc:574:26: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:574:26: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::MatrixBase<Real>&, kaldi::MatrixTransposeType) [with Real = float]’:
kaldi-matrix.cc:1714:16:   required from here
kaldi-matrix.cc:549:18: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M);
                  ^
kaldi-matrix.cc:549:18: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:549:18: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc:552:26: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M, kTrans);
                          ^
kaldi-matrix.cc:552:26: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:552:26: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::Matrix<Real>&) [with Real = float]’:
kaldi-matrix.cc:1714:16:   required from here
kaldi-matrix.cc:561:16: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
   CopyFromMat(M);
                ^
kaldi-matrix.cc:561:16: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:561:16: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘void kaldi::Matrix<Real>::Transpose() [with Real = float]’:
kaldi-matrix.cc:1714:16:   required from here
kaldi-matrix.cc:1615:20: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(tmp);
                    ^
kaldi-matrix.cc:1615:20: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
kaldi-matrix.cc:1615:20: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::MatrixBase<Real>&, kaldi::MatrixTransposeType) [with Real = double]’:
kaldi-matrix.cc:1715:16:   required from here
kaldi-matrix.cc:549:18: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M);
                  ^
kaldi-matrix.cc:549:18: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:549:18: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc:552:26: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(M, kTrans);
                          ^
kaldi-matrix.cc:552:26: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:552:26: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::Matrix<Real>&) [with Real = double]’:
kaldi-matrix.cc:1715:16:   required from here
kaldi-matrix.cc:561:16: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
   CopyFromMat(M);
                ^
kaldi-matrix.cc:561:16: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:561:16: 附注:use ‘this->CopyFromMat’ instead
kaldi-matrix.cc: In instantiation of ‘void kaldi::Matrix<Real>::Transpose() [with Real = double]’:
kaldi-matrix.cc:1715:16:   required from here
kaldi-matrix.cc:1615:20: 警告:‘CopyFromMat’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromMat(tmp);
                    ^
kaldi-matrix.cc:1615:20: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
kaldi-matrix.cc:1615:20: 附注:use ‘this->CopyFromMat’ instead
In file included from ../matrix/kaldi-matrix-inl.h:21:0,
                 from ../matrix/kaldi-matrix.h:757,
                 from kaldi-matrix.cc:21:
../matrix/kaldi-vector.h: In instantiation of ‘kaldi::Vector<Real>::Vector(const kaldi::VectorBase<Real>&) [with Real = float]’:
kaldi-matrix.cc:1549:50:   required from ‘void kaldi::MatrixBase<Real>::SymPosSemiDefEig(kaldi::VectorBase<Real>*, kaldi::MatrixBase<Real>*, Real) [with Real = float]’
kaldi-matrix.cc:1716:16:   required from here
../matrix/kaldi-vector.h:318:18: 警告:‘CopyFromVec’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromVec(v);
                  ^
../matrix/kaldi-vector.h:318:18: 附注:declarations in dependent base ‘kaldi::VectorBase<float>’ are not found by unqualified lookup
../matrix/kaldi-vector.h:318:18: 附注:use ‘this->CopyFromVec’ instead
In file included from kaldi-matrix.cc:21:0:
../matrix/kaldi-matrix.h: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::TpMatrix<OtherReal>&, kaldi::MatrixTransposeType) [with OtherReal = float; Real = float]’:
../matrix/kaldi-matrix.h:403:21:   required from ‘void kaldi::MatrixBase<Real>::AddTpMat(Real, const kaldi::TpMatrix<Real>&, kaldi::MatrixTransposeType, const kaldi::MatrixBase<Real>&, kaldi::MatrixTransposeType, Real) [with Real = float]’
kaldi-matrix.cc:1716:16:   required from here
../matrix/kaldi-matrix.h:552:19: 警告:‘CopyFromTp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
       CopyFromTp(M);
                   ^
../matrix/kaldi-matrix.h:552:19: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:552:19: 附注:use ‘this->CopyFromTp’ instead
../matrix/kaldi-matrix.h:555:27: 警告:‘CopyFromTp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
       CopyFromTp(M, kTrans);
                           ^
../matrix/kaldi-matrix.h:555:27: 附注:declarations in dependent base ‘kaldi::MatrixBase<float>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:555:27: 附注:use ‘this->CopyFromTp’ instead
In file included from ../matrix/kaldi-matrix-inl.h:21:0,
                 from ../matrix/kaldi-matrix.h:757,
                 from kaldi-matrix.cc:21:
../matrix/kaldi-vector.h: In instantiation of ‘kaldi::Vector<Real>::Vector(const kaldi::VectorBase<Real>&) [with Real = double]’:
kaldi-matrix.cc:1549:50:   required from ‘void kaldi::MatrixBase<Real>::SymPosSemiDefEig(kaldi::VectorBase<Real>*, kaldi::MatrixBase<Real>*, Real) [with Real = double]’
kaldi-matrix.cc:1717:16:   required from here
../matrix/kaldi-vector.h:318:18: 警告:‘CopyFromVec’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
     CopyFromVec(v);
                  ^
../matrix/kaldi-vector.h:318:18: 附注:declarations in dependent base ‘kaldi::VectorBase<double>’ are not found by unqualified lookup
../matrix/kaldi-vector.h:318:18: 附注:use ‘this->CopyFromVec’ instead
In file included from kaldi-matrix.cc:21:0:
../matrix/kaldi-matrix.h: In instantiation of ‘kaldi::Matrix<Real>::Matrix(const kaldi::TpMatrix<OtherReal>&, kaldi::MatrixTransposeType) [with OtherReal = double; Real = double]’:
../matrix/kaldi-matrix.h:403:21:   required from ‘void kaldi::MatrixBase<Real>::AddTpMat(Real, const kaldi::TpMatrix<Real>&, kaldi::MatrixTransposeType, const kaldi::MatrixBase<Real>&, kaldi::MatrixTransposeType, Real) [with Real = double]’
kaldi-matrix.cc:1717:16:   required from here
../matrix/kaldi-matrix.h:552:19: 警告:‘CopyFromTp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
       CopyFromTp(M);
                   ^
../matrix/kaldi-matrix.h:552:19: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:552:19: 附注:use ‘this->CopyFromTp’ instead
../matrix/kaldi-matrix.h:555:27: 警告:‘CopyFromTp’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
       CopyFromTp(M, kTrans);
                           ^
../matrix/kaldi-matrix.h:555:27: 附注:declarations in dependent base ‘kaldi::MatrixBase<double>’ are not found by unqualified lookup
../matrix/kaldi-matrix.h:555:27: 附注:use ‘this->CopyFromTp’ instead

Jan Trmal

unread,
Dec 1, 2015, 10:27:06 AM12/1/15
to kaldi-help
I think these issues were fixed already -- you will have to update your kaldi.
I think they do not relate directly to C++11, but there was a change in the function call lookup in gcc

y.

--
You received this message because you are subscribed to the Google Groups "kaldi-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kaldi-help+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

flyd...@gmail.com

unread,
Dec 1, 2015, 8:08:34 PM12/1/15
to kaldi-help
I have changed a lot based the old version of kaldi. So I prefer to use them without update.
Thanks a lot.

在 2015年12月1日星期二 UTC+8下午11:27:06,Yenda写道:

Jan Trmal

unread,
Dec 1, 2015, 8:34:18 PM12/1/15
to kaldi-help

In that  case just replace the calls as gcc asks you to do (eg  replace CopyFromSp by this->CopyFromSp). Or check out a new version of kaldi and use some diff tool to merge these changes manually).
HTH
Y.

flyd...@gmail.com

unread,
Dec 2, 2015, 7:51:24 AM12/2/15
to kaldi-help
The problems were solved by adding 'this->' to the places that gcc asked.
I really appreciate your help.

在 2015年12月2日星期三 UTC+8上午9:34:18,Yenda写道:
Reply all
Reply to author
Forward
0 new messages