linux compilation error

374 views
Skip to first unread message

Nancy Chen

unread,
Mar 6, 2013, 9:20:45 PM3/6/13
to phn...@googlegroups.com
Hi,

I'm compliing PhnRec under linux with BLAS support. The following is what I get after the command "make -f makefile.lin". I don't understand the error. Can someone elaborate on what I might be doing wrong?

Thanks!
Nancy


===

(cd STKLib; make -f Makefile.lin; cd ..)
make[1]: Entering directory `/home/nfychen/research/summarization/brno-phone-decode/PhnRec/STKLib'
g++-4.1 -Wall -g -DDOUBLEPRECISION=0 -D_REENTRANT   -c -o dict.o dict.C
In file included from Matrix.h:523,
                 from Models.h:16,
                 from dict.h:16,
                 from dict.C:13:
Matrix.tcc:14:1: warning: "_XOPEN_SOURCE" redefined
In file included from /usr/include/c++/4.3/x86_64-suse-linux/bits/os_defines.h:44,
                 from /usr/include/c++/4.3/x86_64-suse-linux/bits/c++config.h:1449,
                 from /usr/include/c++/4.3/exception:42,
                 from /usr/include/c++/4.3/stdexcept:43,
                 from Error.h:21,
                 from common.h:16,
                 from Matrix.h:4,
                 from Models.h:16,
                 from dict.h:16,
                 from dict.C:13:
/usr/include/features.h:160:1: warning: this is the location of the previous definition
In file included from stkstream.h:385,
                 from Models.h:18,
                 from dict.h:16,
                 from dict.C:13:
stkstream.tcc: In static member function ‘static void STK::basic_stkbuf<_CharT, _Traits>::open_mode(std::_Ios_Openmode, int&, int&, char*)’:
stkstream.tcc:89: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:89: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
stkstream.tcc:91: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:93: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:95: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:97: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:99: error: there are no arguments to ‘strcpy’ that depend on a template parameter, so a declaration of ‘strcpy’ must be available
stkstream.tcc:101: error: there are no arguments to ‘strcat’ that depend on a template parameter, so a declaration of ‘strcat’ must be available
dict.C: In function ‘void ReadDictionary(const char*, MyHSearchData*, MyHSearchData*)’:
dict.C:35: warning: deprecated conversion from string constant to ‘char*’
dict.C:42: warning: deprecated conversion from string constant to ‘char*’
dict.C:45: warning: deprecated conversion from string constant to ‘char*’
dict.C:56: warning: deprecated conversion from string constant to ‘char*’
dict.C:63: warning: deprecated conversion from string constant to ‘char*’
dict.C:72: warning: deprecated conversion from string constant to ‘char*’
dict.C:86: warning: deprecated conversion from string constant to ‘char*’
dict.C:96: warning: deprecated conversion from string constant to ‘char*’
dict.C:108: warning: deprecated conversion from string constant to ‘char*’
dict.C:115: warning: deprecated conversion from string constant to ‘char*’
dict.C:120: warning: deprecated conversion from string constant to ‘char*’
make[1]: *** [dict.o] Error 1
make[1]: Leaving directory `/home/nfychen/research/summarization/brno-phone-decode/PhnRec/STKLib'
g++ -g -DUSE_BLAS -DDOUBLEPRECISION=0 -D_REENTRANT -I . -ISTKLib -ISTKLib\\gnu -D NN_FAST_EXP -O2 -LSTKLib   -c -o configz.o configz.cpp
configz.cpp: In member function ‘int Config::Load(char*, int*)’:
configz.cpp:134: error: ‘strcpy’ was not declared in this scope
configz.cpp:145: error: ‘strtok’ was not declared in this scope
configz.cpp: In member function ‘int Config::Save(char*)’:
configz.cpp:180: error: ‘strcpy’ was not declared in this scope
configz.cpp: In member function ‘void Config::SetBool(char*, char*, bool)’:
configz.cpp:259: warning: deprecated conversion from string constant to ‘char*’
configz.cpp:261: warning: deprecated conversion from string constant to ‘char*’
make: *** [configz.o] Error 1

Petr Schwarz

unread,
Mar 10, 2013, 7:25:48 PM3/10/13
to phn...@googlegroups.com
Dear Nancy,

It looks like that you are using a compiler that does not include the
string.h header automatically. Please add "#include <string.h>" to all
files where the compiler can not find any of the strXXX functions,
especially to configz.cpp. Then it may be easier for you to use the
makefile_phnrec.lin makefile instead of makefile.lin. This will discard
the STKLib library. It is not necessary for phoneme recognition at all.
It may be useful for some grammar based recognition and keyword spotting
only.

Best regards,
Petr

Dne 7.3.2013 3:20, Nancy Chen napsal(a):
> stkstream.tcc: In static member function �static void
> STK::basic_stkbuf<_CharT, _Traits>::open_mode(std::_Ios_Openmode, int&,
> int&, char*)�:
> stkstream.tcc:89: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:89: error: (if you use �-fpermissive�, G++ will accept your
> code, but allowing the use of an undeclared name is deprecated)
> stkstream.tcc:91: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:93: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:95: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:97: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:99: error: there are no arguments to �strcpy� that depend on
> a template parameter, so a declaration of �strcpy� must be available
> stkstream.tcc:101: error: there are no arguments to �strcat� that depend on
> a template parameter, so a declaration of �strcat� must be available
> dict.C: In function �void ReadDictionary(const char*, MyHSearchData*,
> MyHSearchData*)�:
> dict.C:35: warning: deprecated conversion from string constant to �char*�
> dict.C:42: warning: deprecated conversion from string constant to �char*�
> dict.C:45: warning: deprecated conversion from string constant to �char*�
> dict.C:56: warning: deprecated conversion from string constant to �char*�
> dict.C:63: warning: deprecated conversion from string constant to �char*�
> dict.C:72: warning: deprecated conversion from string constant to �char*�
> dict.C:86: warning: deprecated conversion from string constant to �char*�
> dict.C:96: warning: deprecated conversion from string constant to �char*�
> dict.C:108: warning: deprecated conversion from string constant to �char*�
> dict.C:115: warning: deprecated conversion from string constant to �char*�
> dict.C:120: warning: deprecated conversion from string constant to �char*�
> make[1]: *** [dict.o] Error 1
> make[1]: Leaving directory
> `/home/nfychen/research/summarization/brno-phone-decode/PhnRec/STKLib'
> g++ -g -DUSE_BLAS -DDOUBLEPRECISION=0 -D_REENTRANT -I . -ISTKLib
> -ISTKLib\\gnu -D NN_FAST_EXP -O2 -LSTKLib -c -o configz.o configz.cpp
> configz.cpp: In member function �int Config::Load(char*, int*)�:
> configz.cpp:134: error: �strcpy� was not declared in this scope
> configz.cpp:145: error: �strtok� was not declared in this scope
> configz.cpp: In member function �int Config::Save(char*)�:
> configz.cpp:180: error: �strcpy� was not declared in this scope
> configz.cpp: In member function �void Config::SetBool(char*, char*, bool)�:
> configz.cpp:259: warning: deprecated conversion from string constant to
> �char*�
> configz.cpp:261: warning: deprecated conversion from string constant to
> �char*�

Nancy Chen

unread,
Mar 11, 2013, 11:33:37 PM3/11/13
to phn...@googlegroups.com
Hi Petr,

Thanks so much for your help! I took your advice, and it seems that now I don't have string related errors any more. I'm getting the following error message though. 

Am I missing something so that UINT_MAX was not declared/passed?

Thanks,
Nancy

===
nfychen@SDP-C33-PC1:~/research/summarization/brno-phone-decode/PhnRec> make -f makefile_phnrec.lin
g++ -g -I . -DUSE_BLAS -D NN_FAST_EXP -D PHNREC_ONLY -O2   -c -o norm.o norm.cpp
norm.cpp: In member function âvoid ChannelNormParams::Update()â:
norm.cpp:145: error: âUINT_MAXâ was not declared in this scope
make: *** [norm.o] Error 1

Petr Schwarz

unread,
Mar 12, 2013, 8:51:18 PM3/12/13
to phn...@googlegroups.com
Dear Nancy,

the UINT_MAX is the maximal value that can be stored in unsigned
integer. It is defined in a header file. I guess "limits.h".
So add "#include <limits.h>" at the beginning of the file.

Regards,
Petr

Dne 12.3.2013 4:33, Nancy Chen napsal(a):
> Hi Petr,
>
> Thanks so much for your help! I took your advice, and it seems that now I
> don't have string related errors any more. I'm getting the following error
> message though.
>
> Am I missing something so that UINT_MAX was not declared/passed?
>
> Thanks,
> Nancy
>
> ===
> nfychen@SDP-C33-PC1:~/research/summarization/brno-phone-decode/PhnRec> make
> -f makefile_phnrec.lin
> g++ -g -I . -DUSE_BLAS -D NN_FAST_EXP -D PHNREC_ONLY -O2 -c -o norm.o
> norm.cpp
> norm.cpp: In member function �void ChannelNormParams::Update()�:
> norm.cpp:145: error: �UINT_MAX� was not declared in this scope

muhammed ozturk

unread,
Jan 17, 2014, 3:23:37 AM1/17/14
to phn...@googlegroups.com
Hello,

I want to use this tool for my phonotactic LID project but I cannot even install it to my ubuntu computer.
Could you please help me where I am doing wrong?
I can do the first step without any problem, the makefile step.
But when I try to do the next step, setting the recognition system, I take the following error:

phnrec: command not found
PHN_EN_TIMIT_LCRC_N500: command not found
PHN_HU_SPDAT_LCRC_N1500: command not found
PHN_RU_SPDAT_LCRC_N1500: command not found
PHN_EN_TIMIT_LCRC_N500: command not found

I copied what is written in your website as command, the following part:

phnrec -c PHN_CZ_SPDAT_LCRC_N1500|PHN_HU_SPDAT_LCRC_N1500|PHN_RU_SPDAT_LCRC_N1500|
PHN_EN_TIMIT_LCRC_N500

and I did it with and without ./ but still I get the same error.

Please help me.
thanks


On Wednesday, March 13, 2013 2:51:18 AM UTC+2, Petr Schwarz wrote:
Dear Nancy,

the UINT_MAX is the maximal value that can be stored in unsigned
integer. It is defined in a header file. I guess "limits.h".
So add "#include <limits.h>" at the beginning of the file.

Regards,
Petr

Dne 12.3.2013 4:33, Nancy Chen napsal(a):
> Hi Petr,
>
> Thanks so much for your help! I took your advice, and it seems that now I
> don't have string related errors any more. I'm getting the following error
> message though.
>
> Am I missing something so that UINT_MAX was not declared/passed?
>
> Thanks,
> Nancy
>
> ===
> nfychen@SDP-C33-PC1:~/research/summarization/brno-phone-decode/PhnRec> make
> -f makefile_phnrec.lin
> g++ -g -I . -DUSE_BLAS -D NN_FAST_EXP -D PHNREC_ONLY -O2   -c -o norm.o
> norm.cpp
> norm.cpp: In member function �void ChannelNormParams::Update()�:
> norm.cpp:145: error: �UINT_MAX� was not declared in this scope

Petr Schwarz

unread,
Jan 17, 2014, 3:55:38 PM1/17/14
to phn...@googlegroups.com
Dear Muhammed,

1) check if the executable is in your directory
2) check that the executable has the executable right for you. If not,
set it using chmod, ask admin if you can not change it ...
3) select the configuration directory according to the wanted language
(-c PHN_CZ_SPDAT_LCRC_N1500 for Czech for example), | creates pipes of
commands under Linux
4) run the command with ./ and from the actual directory to be sure that
it will be found.

Best regards,
Petr

Dne 17.1.2014 9:23, muhammed ozturk napsal(a):

muhammed ozturk

unread,
Jan 20, 2014, 3:09:06 AM1/20/14
to phn...@googlegroups.com
Dear Schwarz,

thank you for your reply. I think we found the problem, it stems from the fact that the PhnRec software cannot be compiled with the latest version of the g++ compiler and we handled it by rewriting some of your source codes.
Now, I am able to compile the makefile and set the recognition system.

Sincerely
Muhammed

Sveta

unread,
Apr 15, 2014, 1:40:35 AM4/15/14
to phn...@googlegroups.com
Dear Muhammed,

I am trying to compile the phnrec code i linux and facing problems similar to what you mentioned. Can you please help me in resolving it?

Thanks
Sveta

Tim Kempton

unread,
Jul 8, 2014, 10:36:51 AM7/8/14
to phn...@googlegroups.com
For those trying to compile PhnRec for newer versions of GCC, I came across a patch for PhnRec on GCC 4.5. It's at https://build.opensuse.org/package/view_file/home:inescid:language/phnrec/phnrec-gcc-4.5.patch?rev=a028e8beec2e3a4fe0f28e27b6d7c0bf

e.g. save this as phnrec-gcc-4.5.patch then:

cd PhnRec
patch -p1 < ../phnrec-gcc-4.5.patch

To get it working on my platform (Linux Mint 14 with GCC 4.7)  I had to make a few additional changes: I added

#include <cstring>
to STKLib/Matrix.tcc

Also I removed the change that the patch made to the file srec.h (see patch line 125) i.e. I ensured that line 79 of srec.h was not commented out.

Tim

Kishore Prahlad

unread,
Jul 10, 2014, 1:12:45 PM7/10/14
to phn...@googlegroups.com
Hi Muhammed,

Can u please elaborate on what changes were made to the source codes.
Will it be possible for you to update us the working set of codes such that all others can make use of them ?

Or atleast suggest us on what lines we need to make changes to get them working ?

Thanks,
kishore
Reply all
Reply to author
Forward
0 new messages