Error compiling function using kaldi lib

923 views
Skip to first unread message

Sana Khamekhem

unread,
Feb 22, 2017, 5:06:03 AM2/22/17
to kaldi-help
Hi alls,

I m trying to compile a c file using kaldi libraries, but I have got an error:
lattice-char-to-word.cc:23:31: fatal error: base/kaldi-common.h: No such file or directory
 #include "base/kaldi-common.h"
                               ^
compilation terminated.

Please if you can help me to compile it (kaldi is already installed in my PC);
The makefile content is:

.PHONY: all install
all:
EXTRA_CXXFLAGS = -Wno-sign-compare
include /media/dell/SP/Kaldi/kaldi-master/src/kaldi.mk
BINFILES = lattice-char-to-word

OBJFILES =

TESTFILES =

ADDLIBS = /media/dell/SP/Kaldi/kaldi-master/src/lat/kaldi-lat.a \
    /media/dell/SP/Kaldi/kaldi-master/src/fstext/kaldi-fstext.a \
       /media/dell/SP/Kaldi/kaldi-master/src/hmm/kaldi-hmm.a \
        /media/dell/SP/Kaldi/kaldi-master/src/util/kaldi-util.a \
    /media/dell/SP/Kaldi/kaldi-master/src/matrix/kaldi-matrix.a \
    /media/dell/SP/Kaldi/kaldi-master/src/base/kaldi-base.a \
    /media/dell/SP/Kaldi/kaldi-master/src/thread/kaldi-thread.a


include /media/dell/SP/Kaldi/kaldi-master/src/makefiles/default_rules.mk

PREFIX=/media/dell/SP/Kaldi/kaldi-master/egs/OCR/combinelats

install: lattice-char-to-word
    test -d $(PREFIX) || mkdir -p $(PREFIX)/bin
    install -m 0755 lattice-char-to-word $(PREFIX)/bin

Daniel Povey

unread,
Feb 22, 2017, 1:36:53 PM2/22/17
to kaldi-help
The Makefiles may assume that the think you are compiling is in a subdirectory of src/.


--
Go to http://kaldi-asr.org/forums.html find out how to join
---
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sana Khamekhem

unread,
Feb 22, 2017, 2:19:33 PM2/22/17
to kaldi...@googlegroups.com
 Thanks  for your response,
I have moved the repo into src\lats and chaged the makefile  like:

all:
EXTRA_CXXFLAGS = -Wno-sign-compare
include ../kaldi.mk


BINFILES = lattice-char-to-word

OBJFILES =

TESTFILES =

ADDLIBS = \
    ../lat/kaldi-lat.a \
    ../fstext/kaldi-fstext.a \
        ../hmm/kaldi-hmm.a \
        ../util/kaldi-util.a \
    ../matrix/kaldi-matrix.a \
    ../thread/kaldi-thread.a \
    ../base/kaldi-base.a


include ../makefiles/default_rules.mk



but : errors....



/usr/include/c++/4.9/bits/stl_iterator_base_types.h:118:12: note:   ‘std::iterator’
/usr/include/c++/4.9/bits/stl_iterator_base_types.h:118:12: note:   ‘std::iterator’
In file included from ../fstext/determinize-lattice.h:148:0,
                 from ../fstext/fstext-lib.h:33,
                 from ../lat/kaldi-lattice.h:24,
                 from lattice-char-to-word.cc:27:
../fstext/determinize-lattice-inl.h:172:37: error: expected ‘;’ before ‘iter’
     for (typename SetType::iterator iter = set_.begin();
                                     ^
../fstext/determinize-lattice-inl.h:172:37: error: ‘iter’ was not declared in this scope
../fstext/determinize-lattice-inl.h:172:44: error: ‘set_’ was not declared in this scope
     for (typename SetType::iterator iter = set_.begin();
                                            ^
../fstext/determinize-lattice-inl.h:172:56: error: expected ‘)’ before ‘;’ token
     for (typename SetType::iterator iter = set_.begin();
                                                        ^
../fstext/determinize-lattice-inl.h:173:10: error: ‘iter’ was not declared in this scope
          iter != set_.end();
          ^
../fstext/determinize-lattice-inl.h:173:18: error: ‘set_’ was not declared in this scope
          iter != set_.end();
                  ^
../fstext/determinize-lattice-inl.h:176:5: error: ‘SetType’ was not declared in this scope
     SetType tmp;
     ^
../fstext/determinize-lattice-inl.h:177:5: error: ‘tmp’ was not declared in this scope
     tmp.swap(set_);

                  ^


You received this message because you are subscribed to a topic in the Google Groups "kaldi-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kaldi-help/BUVOgfEhBNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kaldi-help+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Best regards,
   Sana Khamekhem Jemni
_________________________________________
PhD Student 
MIRACL Laboratory
ENIS
_________________________________________
lattice-char-to-word.cc

Daniel Povey

unread,
Feb 22, 2017, 2:31:01 PM2/22/17
to kaldi-help
Probably some Makefile problem; I suggest to go to latbin/, make sure things are compiling OK there, then add your program to BINFILES there and move it there.

Sana Khamekhem

unread,
Feb 23, 2017, 12:44:36 AM2/23/17
to kaldi-help, dpo...@gmail.com
I did  like you have suggested exactly, but:

/usr/include/c++/4.9/bits/stl_iterator_base_types.h:169:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::reference         reference;
                                                     ^
In file included from ../base/kaldi-common.h:38:0,
                 from lattice-char-to-word.cc:23:
../base/kaldi-math.h: At global scope:
../base/kaldi-math.h:130:17: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used [-Wunused-variable]
 const BaseFloat kLogZeroBaseFloat = -std::numeric_limits<BaseFloat>::infinity();
                 ^
<builtin>: recipe for target 'lattice-char-to-word' failed
make[1]: *** [lattice-char-to-word] Error 1
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/latbin'
Makefile:145: recipe for target 'latbin' failed
make: *** [latbin] Error 2

Daniel Povey

unread,
Feb 23, 2017, 12:55:35 AM2/23/17
to Sana Khamekhem, kaldi-help
I think you are showing only part of the error output.
Probably it is a linking error, requiring something to be added to ADDLIBS, but you have not shown the error message that shows the actual error.

Daniel Povey

unread,
Feb 23, 2017, 1:07:12 AM2/23/17
to Sana Khamekhem, kaldi-help
It's due to errors in the code you are compiling, which is see is 3rd-party code.
Some of could be resolved fairly easily, like removing namespace specifiers like std:: from unordered_set/map.
However, it's not a good use of my time to help you with basic C++ questions.  You should find someone local who knows C++ well.


On Thu, Feb 23, 2017 at 1:02 AM, Sana Khamekhem <sana.kh...@gmail.com> wrote:
make -j 8
test -d /media/dell/SP/Kaldi/kaldi-master/src/lib || mkdir /media/dell/SP/Kaldi/kaldi-master/src/lib
The version of configure script matches kaldi.mk version. Good.
make -C base
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/base'
./get_version.sh: Git history is not available. ./get_version.sh: Using the version number "5.0" specified in src/.version.
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/base'
make -C matrix
make -C thread
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/thread'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/matrix'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/thread'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/matrix'
make -C util
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/util'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/util'
make -C tree
make -C cudamatrix
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/tree'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/cudamatrix'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/tree'
make -C gmm
make -C fstext
make -C hmm
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/hmm'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/gmm'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/fstext'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/cudamatrix'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/fstext'
make -C lm
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/gmm'
make -C transform
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/lm'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/transform'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/hmm'
make -C lat
make -C nnet
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/lat'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/transform'
make -C feat
make -C sgmm2
make -C ivector
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/feat'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/sgmm2'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/ivector'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/lm'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/lat'
make -C decoder
make -C kws
make -C nnet2
make -C chain
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet2'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/kws'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/decoder'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/chain'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/sgmm2'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/ivector'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/feat'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/decoder'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/kws'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet2'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/chain'
make -C nnet3
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet3'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet3'
make -C online2
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/online2'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/online2'
make -C bin
make -C fstbin
make -C gmmbin
make -C fgmmbin
make -C featbin
make -C nnetbin
make -C latbin
make -C sgmm2bin
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/featbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/fstbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/latbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/gmmbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnetbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/fgmmbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/bin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/sgmm2bin'
g++ -msse -msse2 -Wall -I.. -pthread -DKALDI_DOUBLEPRECISION=0 -Wno-sign-compare -Wno-unused-local-typedefs -Winit-self -DHAVE_EXECINFO_H=1 -rdynamic -DHAVE_CXXABI_H -DHAVE_ATLAS -I/media/dell/SP/Kaldi/kaldi-master/tools/ATLAS/include -I/media/dell/SP/Kaldi/kaldi-master/tools/openfst/include -Wno-sign-compare -g  -fPIC -DHAVE_CUDA -I/usr/local/cuda/include  -rdynamic -Wl,-rpath=/media/dell/SP/Kaldi/kaldi-master/tools/openfst/lib -Wl,-rpath=/media/dell/SP/Kaldi/kaldi-master/src/lib -L.  -L../lat/   -L../lm/   -L../fstext/   -L../hmm/   -L../tree/   -L../util/   -L../thread/   -L../matrix/   -L../base/   lattice-char-to-word.cc ../lat//libkaldi-lat.so ../lm//libkaldi-lm.so ../fstext//libkaldi-fstext.so ../hmm//libkaldi-hmm.so ../tree//libkaldi-tree.so ../util//libkaldi-util.so ../thread//libkaldi-thread.so ../matrix//libkaldi-matrix.so ../base//libkaldi-base.so   -L/media/dell/SP/Kaldi/kaldi-master/tools/openfst/lib -lfst /usr/lib/libatlas.so.3 /usr/lib/libf77blas.so.3 /usr/lib/libcblas.so.3 /usr/lib/liblapack_atlas.so.3 -lm -lpthread -ldl  -lkaldi-lat   -lkaldi-lm   -lkaldi-fstext   -lkaldi-hmm   -lkaldi-tree   -lkaldi-util   -lkaldi-thread   -lkaldi-matrix   -lkaldi-base  -o lattice-char-to-word
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/fgmmbin'
make -C nnet3bin
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet3bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/featbin'
make -C nnet2bin
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/fstbin'
make -C kwsbin
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet2bin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/kwsbin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/sgmm2bin'
make -C ivectorbin
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnetbin'
make -C online2bin
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/ivectorbin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/online2bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/gmmbin'
make -C lmbin
rm -f arpa2fst
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/bin'
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/lmbin'
make -C chainbin
make[1]: Entering directory '/media/dell/SP/Kaldi/kaldi-master/src/chainbin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/ivectorbin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/kwsbin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet3bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/nnet2bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/online2bin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/lmbin'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/chainbin'
lattice-char-to-word.cc:35:16: error: ‘unordered_set’ in namespace ‘std’ does not name a template type
     const std::unordered_set<typename Arc::Label>& delim,
                ^
lattice-char-to-word.cc:35:29: error: expected ‘,’ or ‘...’ before ‘<’ token
     const std::unordered_set<typename Arc::Label>& delim,
                             ^
lattice-char-to-word.cc:40:56: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
                        typename Arc::Label>* olabel_map) {
                                                        ^
lattice-char-to-word.cc: In function ‘void fst::ExpandFst(const fst::Fst<A>&, int)’:
lattice-char-to-word.cc:45:16: error: ‘tuple’ in namespace ‘std’ does not name a template type
   typedef std::tuple< StateId,
                ^
In file included from ../base/kaldi-common.h:35:0,
                 from lattice-char-to-word.cc:23:
lattice-char-to-word.cc:50:16: error: ‘ofst’ was not declared in this scope
   KALDI_ASSERT(ofst != NULL);
                ^
../base/kaldi-error.h:169:37: note: in definition of macro ‘KALDI_ASSERT’
 #define KALDI_ASSERT(cond) do { if (cond) (void)0; else \
                                     ^
lattice-char-to-word.cc:51:16: error: ‘ilabel_map’ was not declared in this scope
   KALDI_ASSERT(ilabel_map != NULL);
                ^
../base/kaldi-error.h:169:37: note: in definition of macro ‘KALDI_ASSERT’
 #define KALDI_ASSERT(cond) do { if (cond) (void)0; else \
                                     ^
lattice-char-to-word.cc:52:16: error: ‘olabel_map’ was not declared in this scope
   KALDI_ASSERT(olabel_map != NULL);
                ^
../base/kaldi-error.h:169:37: note: in definition of macro ‘KALDI_ASSERT’
 #define KALDI_ASSERT(cond) do { if (cond) (void)0; else \
                                     ^
lattice-char-to-word.cc:55:3: error: ‘ilabel_map’ was not declared in this scope
   ilabel_map->insert(make_pair(std::vector<Label>{}, 0));
   ^
lattice-char-to-word.cc:55:50: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
   ilabel_map->insert(make_pair(std::vector<Label>{}, 0));
                                                  ^
lattice-char-to-word.cc:56:3: error: ‘olabel_map’ was not declared in this scope
   olabel_map->insert(make_pair(std::vector<Label>{}, 0));
   ^
lattice-char-to-word.cc:56:50: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
   olabel_map->insert(make_pair(std::vector<Label>{}, 0));
                                                  ^
lattice-char-to-word.cc:59:3: error: ‘ofst’ was not declared in this scope
   ofst->DeleteStates();
   ^
lattice-char-to-word.cc:66:3: error: ‘unordered_set’ is not a member of ‘std’
   std::unordered_set<StateId> add_to_initial_stack;
   ^
lattice-char-to-word.cc:66:3: note: suggested alternatives:
In file included from /usr/include/c++/4.9/tr1/unordered_set:42:0,
                 from ../util/stl-utils.h:35,
                 from ../util/kaldi-table-inl.h:34,
                 from ../util/kaldi-table.h:468,
                 from ../util/common-utils.h:27,
                 from lattice-char-to-word.cc:24:
/usr/include/c++/4.9/tr1/unordered_set.h:173:11: note:   ‘std::tr1::unordered_set’
     class unordered_set
           ^
/usr/include/c++/4.9/tr1/unordered_set.h:173:11: note:   ‘std::tr1::unordered_set’
lattice-char-to-word.cc:66:29: error: expected primary-expression before ‘>’ token
   std::unordered_set<StateId> add_to_initial_stack;
                             ^
lattice-char-to-word.cc:66:31: error: ‘add_to_initial_stack’ was not declared in this scope
   std::unordered_set<StateId> add_to_initial_stack;
                               ^
lattice-char-to-word.cc:81:11: error: ‘delim’ was not declared in this scope
       if (delim.count(match_label) != 0) {
           ^
lattice-char-to-word.cc:98:14: error: ‘SState’ was not declared in this scope
   std::stack<SState> S;
              ^
lattice-char-to-word.cc:98:20: error: template argument 1 is invalid
   std::stack<SState> S;
                    ^
lattice-char-to-word.cc:98:20: error: template argument 2 is invalid
lattice-char-to-word.cc:98:23: error: invalid type in declaration before ‘;’ token
   std::stack<SState> S;
                       ^
lattice-char-to-word.cc:99:20: error: range-based ‘for’ loops are not allowed in C++98 mode
   for (StateId s : add_to_initial_stack) {
                    ^
lattice-char-to-word.cc:100:7: error: request for member ‘push’ in ‘S’, which is of non-class type ‘int’
     S.push(SState(s, s, Weight::One(),
       ^
lattice-char-to-word.cc:101:37: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                   std::vector<Label>{}, std::vector<Label>{}));
                                     ^
lattice-char-to-word.cc:101:59: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
                   std::vector<Label>{}, std::vector<Label>{}));
                                                           ^
lattice-char-to-word.cc:104:13: error: request for member ‘empty’ in ‘S’, which is of non-class type ‘int’
   while (!S.empty()) {
             ^
lattice-char-to-word.cc:105:11: error: ‘SState’ does not name a type
     const SState s = S.top(); S.pop();
           ^
lattice-char-to-word.cc:105:33: error: request for member ‘pop’ in ‘S’, which is of non-class type ‘int’
     const SState s = S.top(); S.pop();
                                 ^
lattice-char-to-word.cc:106:25: error: ‘get’ is not a member of ‘std’
     const StateId& q0 = std::get<0>(s), q1 = std::get<1>(s);
                         ^
lattice-char-to-word.cc:106:37: error: name lookup of ‘s’ changed for ISO ‘for’ scoping [-fpermissive]
     const StateId& q0 = std::get<0>(s), q1 = std::get<1>(s);
                                     ^
lattice-char-to-word.cc:106:37: note: (if you use ‘-fpermissive’ G++ will accept your code)
lattice-char-to-word.cc:106:46: error: ‘get’ is not a member of ‘std’
     const StateId& q0 = std::get<0>(s), q1 = std::get<1>(s);
                                              ^
lattice-char-to-word.cc:107:23: error: ‘get’ is not a member of ‘std’
     const Weight& w = std::get<2>(s);
                       ^
lattice-char-to-word.cc:108:38: error: ‘get’ is not a member of ‘std’
     const std::vector<Label> ilbls = std::get<3>(s), olbls = std::get<4>(s);
                                      ^
lattice-char-to-word.cc:108:62: error: ‘get’ is not a member of ‘std’
     const std::vector<Label> ilbls = std::get<3>(s), olbls = std::get<4>(s);
                                                              ^
lattice-char-to-word.cc:114:11: error: ‘delim’ was not declared in this scope
       if (delim.count(match_label) == 0) {
           ^
lattice-char-to-word.cc:117:27: error: ‘max_length’ was not declared in this scope
         if (new_length <= max_length) {
                           ^
lattice-char-to-word.cc:123:13: error: request for member ‘push’ in ‘S’, which is of non-class type ‘int’
           S.push(SState(q0, arc.nextstate, Times(w, arc.weight), i_l, o_l));
             ^
lattice-char-to-word.cc: In function ‘void fst::MapToSymbolsTable(const M&, fst::SymbolTable*)’:
lattice-char-to-word.cc:153:49: error: ‘>>’ should be ‘> >’ within a nested template argument list
   std::vector<std::pair<mapped_type, std::string>> vmap;
                                                 ^
lattice-char-to-word.cc:154:14: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
   for (const auto& k_v : smap) {
              ^
lattice-char-to-word.cc:154:20: error: ISO C++ forbids declaration of ‘k_v’ with no type [-fpermissive]
   for (const auto& k_v : smap) {
                    ^
lattice-char-to-word.cc:154:26: error: range-based ‘for’ loops are not allowed in C++98 mode
   for (const auto& k_v : smap) {
                          ^
lattice-char-to-word.cc:155:29: error: request for member ‘first’ in ‘k_v’, which is of non-class type ‘const int’
     const key_type& k = k_v.first;
                             ^
lattice-char-to-word.cc:156:32: error: request for member ‘second’ in ‘k_v’, which is of non-class type ‘const int’
     const mapped_type& v = k_v.second;
                                ^
lattice-char-to-word.cc:158:33: error: range-based ‘for’ loops are not allowed in C++98 mode
     for (const mapped_type& c : k) {
                                 ^
lattice-char-to-word.cc:163:16: error: ‘std::string’ has no member named ‘pop_back’
     else { str.pop_back(); }         // pop last _
                ^
lattice-char-to-word.cc:169:14: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
   for (const auto& k_v : vmap) {
              ^
lattice-char-to-word.cc:169:20: error: ISO C++ forbids declaration of ‘k_v’ with no type [-fpermissive]
   for (const auto& k_v : vmap) {
                    ^
lattice-char-to-word.cc:169:26: error: range-based ‘for’ loops are not allowed in C++98 mode
   for (const auto& k_v : vmap) {
                          ^
lattice-char-to-word.cc:170:32: error: request for member ‘first’ in ‘k_v’, which is of non-class type ‘const int’
     const mapped_type& k = k_v.first;
                                ^
lattice-char-to-word.cc:171:32: error: request for member ‘second’ in ‘k_v’, which is of non-class type ‘const int’
     const std::string& v = k_v.second;
                                ^
lattice-char-to-word.cc: At global scope:
lattice-char-to-word.cc:182:8: error: ‘hash’ is not a class template
 struct hash<std::vector<kaldi::CompactLatticeArc::Label>> {
        ^
lattice-char-to-word.cc:182:56: error: ‘>>’ should be ‘> >’ within a nested template argument list
 struct hash<std::vector<kaldi::CompactLatticeArc::Label>> {
                                                        ^
lattice-char-to-word.cc:182:59: error: explicit specialization of non-template ‘std::hash’
 struct hash<std::vector<kaldi::CompactLatticeArc::Label>> {
                                                           ^
lattice-char-to-word.cc: In member function ‘std::size_t std::hash::operator()(const argument_type&) const’:
lattice-char-to-word.cc:185:5: error: ‘std::hash’ is not a template
     hash<kaldi::CompactLatticeArc::Label> hashe;
     ^
lattice-char-to-word.cc:187:16: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
     for (const auto& s : v) {
                ^
lattice-char-to-word.cc:187:22: error: ISO C++ forbids declaration of ‘s’ with no type [-fpermissive]
     for (const auto& s : v) {
                      ^
lattice-char-to-word.cc:187:26: error: range-based ‘for’ loops are not allowed in C++98 mode
     for (const auto& s : v) {
                          ^
lattice-char-to-word.cc:188:19: error: no match for call to ‘(std::hash) (const int&)’
       h ^= hashe(s) + 0x9e3779b9 + (h << 6) + (h >> 2);
                   ^
lattice-char-to-word.cc:182:8: note: candidate is:
 struct hash<std::vector<kaldi::CompactLatticeArc::Label>> {
        ^
lattice-char-to-word.cc:184:10: note: std::size_t std::hash::operator()(const argument_type&) const
   size_t operator()(const argument_type& v) const {
          ^
lattice-char-to-word.cc:184:10: note:   no known conversion for argument 1 from ‘const int’ to ‘const argument_type& {aka const std::vector<int>&}’
lattice-char-to-word.cc: In function ‘int main(int, char**)’:
lattice-char-to-word.cc:253:5: error: ‘unordered_set’ is not a member of ‘std’
     std::unordered_set<Label> delimiter_symbols;
     ^
lattice-char-to-word.cc:253:5: note: suggested alternatives:
In file included from /usr/include/c++/4.9/tr1/unordered_set:42:0,
                 from ../util/stl-utils.h:35,
                 from ../util/kaldi-table-inl.h:34,
                 from ../util/kaldi-table.h:468,
                 from ../util/common-utils.h:27,
                 from lattice-char-to-word.cc:24:
/usr/include/c++/4.9/tr1/unordered_set.h:173:11: note:   ‘std::tr1::unordered_set’
     class unordered_set
           ^
/usr/include/c++/4.9/tr1/unordered_set.h:173:11: note:   ‘std::tr1::unordered_set’
lattice-char-to-word.cc:253:29: error: expected primary-expression before ‘>’ token
     std::unordered_set<Label> delimiter_symbols;
                             ^
lattice-char-to-word.cc:253:31: error: ‘delimiter_symbols’ was not declared in this scope
     std::unordered_set<Label> delimiter_symbols;
                               ^
lattice-char-to-word.cc:269:67: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     std::vector<std::vector<double> > scale(2, std::vector<double>{0.0, 0.0});
                                                                   ^
lattice-char-to-word.cc:273:68: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     std::vector<std::vector<double> > iscale(2, std::vector<double>{0.0, 0.0});
                                                                    ^
lattice-char-to-word.cc:280:5: error: ‘unordered_map’ is not a member of ‘std’
     std::unordered_map<std::vector<Label>, Label> label_map;
     ^
lattice-char-to-word.cc:280:5: note: suggested alternatives:
In file included from /usr/include/c++/4.9/tr1/unordered_map:42:0,
                 from ../util/stl-utils.h:34,
                 from ../util/kaldi-table-inl.h:34,
                 from ../util/kaldi-table.h:468,
                 from ../util/common-utils.h:27,
                 from lattice-char-to-word.cc:24:
/usr/include/c++/4.9/tr1/unordered_map.h:180:11: note:   ‘std::tr1::unordered_map’
     class unordered_map
           ^
/usr/include/c++/4.9/tr1/unordered_map.h:180:11: note:   ‘std::tr1::unordered_map’
lattice-char-to-word.cc:280:42: error: expected primary-expression before ‘,’ token
     std::unordered_map<std::vector<Label>, Label> label_map;
                                          ^
lattice-char-to-word.cc:280:49: error: expected primary-expression before ‘>’ token
     std::unordered_map<std::vector<Label>, Label> label_map;
                                                 ^
lattice-char-to-word.cc:280:51: error: ‘label_map’ was not declared in this scope
     std::unordered_map<std::vector<Label>, Label> label_map;
                                                   ^
In file included from /usr/include/c++/4.9/bits/stl_algobase.h:65:0,
                 from /usr/include/c++/4.9/bits/char_traits.h:39,
                 from /usr/include/c++/4.9/string:40,
                 from ../base/kaldi-common.h:26,
                 from lattice-char-to-word.cc:23:
/usr/include/c++/4.9/bits/stl_iterator_base_types.h: In instantiation of ‘struct std::iterator_traits<double>’:
/usr/include/c++/4.9/bits/stl_vector.h:1262:24:   required from ‘void std::vector<_Tp, _Alloc>::_M_initialize_dispatch(_InputIterator, _InputIterator, std::__false_type) [with _InputIterator = double; _Tp = double; _Alloc = std::allocator<double>]’
/usr/include/c++/4.9/bits/stl_vector.h:413:55:   required from ‘std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with _InputIterator = double; _Tp = double; _Alloc = std::allocator<double>; std::vector<_Tp, _Alloc>::allocator_type = std::allocator<double>]’
lattice-char-to-word.cc:269:76:   required from here
/usr/include/c++/4.9/bits/stl_iterator_base_types.h:165:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::iterator_category iterator_category;
                                                     ^
/usr/include/c++/4.9/bits/stl_iterator_base_types.h:166:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::value_type        value_type;
                                                     ^
/usr/include/c++/4.9/bits/stl_iterator_base_types.h:167:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::difference_type   difference_type;
                                                     ^
/usr/include/c++/4.9/bits/stl_iterator_base_types.h:168:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::pointer           pointer;
                                                     ^

/usr/include/c++/4.9/bits/stl_iterator_base_types.h:169:53: error: ‘double’ is not a class, struct, or union type
       typedef typename _Iterator::reference         reference;
                                                     ^
In file included from ../base/kaldi-common.h:38:0,
                 from lattice-char-to-word.cc:23:
../base/kaldi-math.h: At global scope:
../base/kaldi-math.h:130:17: warning: ‘kaldi::kLogZeroBaseFloat’ defined but not used [-Wunused-variable]
 const BaseFloat kLogZeroBaseFloat = -std::numeric_limits<BaseFloat>::infinity();
                 ^
<builtin>: recipe for target 'lattice-char-to-word' failed
make[1]: *** [lattice-char-to-word] Error 1
make[1]: Leaving directory '/media/dell/SP/Kaldi/kaldi-master/src/latbin'
Makefile:145: recipe for target 'latbin' failed
make: *** [latbin] Error 2

Reply all
Reply to author
Forward
0 new messages