Fpermissive compile error

161 views
Skip to first unread message

sorous...@gmail.com

unread,
Jul 4, 2017, 10:30:34 AM7/4/17
to kaldi-help
Hi, I was doing the tutorial which is located in the following link precisely in order to become familiar with modifying codes and debugging in kaldi.

http://kaldi-asr.org/doc/tutorial_code.html

But after typing "make test " and hitting enter button, I encountered some compile error as follow.

matrix-lib-test.cc: In function ‘void kaldi::UnitTestAddVec()’:
matrix-lib-test.cc:4578:29: error: there are no arguments to ‘w’ that depend on a template parameter, so a declaration of ‘w’ must be available [-fpermissive]
   Vector<Real> v(dim); w(dim); // two vectors the same size.
                             ^
matrix-lib-test.cc:4578:29: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
matrix-lib-test.cc:4580:13: error: ‘w’ was not declared in this scope
   InitRand(&w);
             ^
matrix-lib-test.cc:4586:20: error: ‘b’ was not declared in this scope
     AssertEqual(a, b); // will crash if not equal to within
                    ^
<builtin>: recipe for target 'matrix-lib-test.o' failed
make: *** [matrix-lib-test.o] Error 1

.
I don't know why this happened since I did everything according to tutorial. I would appreciate if someone could help me how to overcome this problem
it is worthy to know that I have installed kaldi about two years ago by loading files from github. So I think, it is up to date.

Daniel Povey

unread,
Jul 4, 2017, 1:09:51 PM7/4/17
to kaldi-help
That part of the tutorial does warn you "we have deliberately inserted
two errors into the code".
It's kind of intended for people who know the rudiments of C.
Ask someone near you who knows C.
> --
> 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+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

sorous...@gmail.com

unread,
Jul 4, 2017, 2:28:12 PM7/4/17
to kaldi-help, dpo...@gmail.com
I know about that. but the problem is that i compiled that part without the wrong part to see that everything is working fine or not. also, the compile error is not from the wrong code which is mentioned in the tutorial but in the source code of kaldi.
Reply all
Reply to author
Forward
0 new messages