Festival TTS API / CodeBlocks 构建问题!
我想将 Festival TTS API 与 CodeBlocks 结合使用。我创建了一个新项目,并在构建选项>链接器设置中添加:
- libFestival.a
- libestools.a
- libestbase.a
- libeststring.a
我还在全局编译器设置>搜索目录>编译器中添加:
- festival\src\include
- voice_tools\include
我正在使用 gnu gcc 编译器(mingw 版本的代码块),这是我的程序:
#include <iostream>
#include "festival.h"
using namespace std;
int main(int argc, char **argv)
{
EST_Wave wave;
int heap_size = 210000; // default scheme heap size
int load_init_files = 1; // we want the festival init files loaded
festival_initialize(load_init_files,heap_size);
// Say simple file
festival_say_file("/etc/motd");
festival_eval_command("(voice_ked_diphone)");
// Say some text;
festival_say_text("hello world");
// Convert to a waveform
festival_text_to_wave("hello world",wave);
wave.save("/tmp/wave.wav","riff");
// festival_say_file puts the system in async mode so we better
// wait for the spooler to reach the last waveform before exiting
// This isn't necessary if only festival_say_text is being used (and
// your own wave playing stuff)
festival_wait_for_spooler();
return 0;
}
构建日志:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
In file included from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\0621\source\build\speech_tools\include/EST_unix.h:53:25: error: sys/wait.h: No such file or directory
C:\0621\source\build\speech_tools\include/EST_unix.h:54:29: error: sys/resource.h: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings
编辑:我安装了 Cygwin,并在搜索目录中添加了 cygwin/usr/include 文件夹。现在我有:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
In file included from C:\0621\source\build\speech_tools\include/EST_io_aux.h:74,
from C:\0621\source\build\speech_tools\include/EST.h:56,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/Winsock2.h:103:2: warning: #warning "fd_set and associated macros have been defined in sys/types. This may cause runtime problems with W32 sockets"
In file included from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/bits/postypes.h:42,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/iosfwd:42,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/ios:39,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/ostream:40,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/iostream:40,
from C:\0621\source\build\ejecutable\main.cpp:1:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cwchar:249: error: '::wcstold' has not been declared
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cwchar:266: error: '__gnu_cxx::wcstold' has not been declared
In file included from C:\0621\source\build\festival\src\include/festival.h:42,
from C:\0621\source\build\ejecutable\main.cpp:2:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cstdlib:195: error: '::strtold' has not been declared
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cstdlib:215: error: '__gnu_cxx::strtold' has not been declared
In file included from C:\cygwin\usr\include/sys/wait.h:15,
from C:\0621\source\build\speech_tools\include/EST_unix.h:53,
from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\cygwin\usr\include/sys/resource.h:76: error: 'id_t' has not been declared
C:\cygwin\usr\include/sys/resource.h:77: error: 'id_t' has not been declared
In file included from C:\cygwin\usr\include/dirent.h:6,
from C:\0621\source\build\speech_tools\include/EST_unix.h:55,
from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\cygwin\usr\include/sys/dirent.h:24: error: '__ino64_t' does not name a type
Process terminated with status 1 (0 minutes, 0 seconds)
7 errors, 1 warnings
编辑:如果我将编译器更改为 Cygwin:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
Execution of 'g++.exe -Wall -fexceptions -Wall -g -IC:/0621/source/build/festival/src/include -IC:/0621/source/build/speech_tools/include -c C:/0621/source/build/ejecutable/main.cpp -o obj/Debug/main.o' in 'C:\0621\source\build\ejecutable' failed.
Nothing to be done.
有什么想法吗?
I want to use Festival TTS API with CodeBlocks. I have created a new project, and added in build options>linker settings:
- libFestival.a
- libestools.a
- libestbase.a
- libeststring.a
I also added in the global compiler settings>search directories>compiler:
- festival\src\include
- speech_tools\include
I am using gnu gcc compiler (mingw version of codeblocks) and this is my program:
#include <iostream>
#include "festival.h"
using namespace std;
int main(int argc, char **argv)
{
EST_Wave wave;
int heap_size = 210000; // default scheme heap size
int load_init_files = 1; // we want the festival init files loaded
festival_initialize(load_init_files,heap_size);
// Say simple file
festival_say_file("/etc/motd");
festival_eval_command("(voice_ked_diphone)");
// Say some text;
festival_say_text("hello world");
// Convert to a waveform
festival_text_to_wave("hello world",wave);
wave.save("/tmp/wave.wav","riff");
// festival_say_file puts the system in async mode so we better
// wait for the spooler to reach the last waveform before exiting
// This isn't necessary if only festival_say_text is being used (and
// your own wave playing stuff)
festival_wait_for_spooler();
return 0;
}
Build log:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
In file included from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\0621\source\build\speech_tools\include/EST_unix.h:53:25: error: sys/wait.h: No such file or directory
C:\0621\source\build\speech_tools\include/EST_unix.h:54:29: error: sys/resource.h: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings
EDIT: I installed Cygwin, and added the cygwin/usr/include folder in the search directories. Now I have:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
In file included from C:\0621\source\build\speech_tools\include/EST_io_aux.h:74,
from C:\0621\source\build\speech_tools\include/EST.h:56,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/../../../../include/Winsock2.h:103:2: warning: #warning "fd_set and associated macros have been defined in sys/types. This may cause runtime problems with W32 sockets"
In file included from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/bits/postypes.h:42,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/iosfwd:42,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/ios:39,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/ostream:40,
from c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/iostream:40,
from C:\0621\source\build\ejecutable\main.cpp:1:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cwchar:249: error: '::wcstold' has not been declared
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cwchar:266: error: '__gnu_cxx::wcstold' has not been declared
In file included from C:\0621\source\build\festival\src\include/festival.h:42,
from C:\0621\source\build\ejecutable\main.cpp:2:
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cstdlib:195: error: '::strtold' has not been declared
c:\archivos de programa\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.1/include/c++/cstdlib:215: error: '__gnu_cxx::strtold' has not been declared
In file included from C:\cygwin\usr\include/sys/wait.h:15,
from C:\0621\source\build\speech_tools\include/EST_unix.h:53,
from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\cygwin\usr\include/sys/resource.h:76: error: 'id_t' has not been declared
C:\cygwin\usr\include/sys/resource.h:77: error: 'id_t' has not been declared
In file included from C:\cygwin\usr\include/dirent.h:6,
from C:\0621\source\build\speech_tools\include/EST_unix.h:55,
from C:\0621\source\build\speech_tools\include/EST_error.h:54,
from C:\0621\source\build\speech_tools\include/EST_Val.h:52,
from C:\0621\source\build\speech_tools\include/EST_FMatrix.h:47,
from C:\0621\source\build\speech_tools\include/EST_types.h:47,
from C:\0621\source\build\speech_tools\include/EST_string_aux.h:45,
from C:\0621\source\build\speech_tools\include/EST.h:49,
from C:\0621\source\build\festival\src\include/festival.h:47,
from C:\0621\source\build\ejecutable\main.cpp:2:
C:\cygwin\usr\include/sys/dirent.h:24: error: '__ino64_t' does not name a type
Process terminated with status 1 (0 minutes, 0 seconds)
7 errors, 1 warnings
EDIT: If I change the compiler to Cygwin:
-------------- Build: Debug in ejecutable ---------------
Compiling: main.cpp
Execution of 'g++.exe -Wall -fexceptions -Wall -g -IC:/0621/source/build/festival/src/include -IC:/0621/source/build/speech_tools/include -c C:/0621/source/build/ejecutable/main.cpp -o obj/Debug/main.o' in 'C:\0621\source\build\ejecutable' failed.
Nothing to be done.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用 cygwin 编译器,而不是 mingw 编译器。有许多运行时环境特定的头文件和库在两个系统之间不兼容,当使用错误的编译器时很容易被包含。此外,cygwin 编译器确实包含与 mingw 编译器不同的补丁。
You need to use the cygwin compilers, not the mingw ones. There are lots of runtime-environment specific headers and libs which are incompatible between the two systems, which easily get included when the wrong compiler is used. Also the cygwin compilers does contain different patches than the mingw compilers.