2010-06-29 6 views
0

Je souhaite utiliser l'API Festival TTS avec CodeBlocks. J'ai créé un nouveau projet, et a ajouté dans les options de construction> Paramètres de l'éditeur de liens:Festival TTS API/CodeBlocks Problèmes de construction!

  • libFestival.a
  • libestools.a
  • libestbase.a
  • libeststring.a

I également ajouté dans les paramètres du compilateur global> répertoires de recherche> compilateur:

  • Festival \ src \ include
  • speech_tools \ include

J'utilise le compilateur gcc gnu (version mingw de codeblocks) et voici mon programme:

#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; 
} 

Construire journal:

-------------- 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: J'ai installé Cygwin et ajouté le dossier cygwin/usr/include dans les répertoires de recherche. Maintenant, j'ai:

-------------- 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: Si je change le compilateur 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. 

Toute idée?

Répondre

1

Vous devez utiliser les compilateurs cygwin, pas ceux de Mww. Il y a beaucoup d'en-têtes et de libs spécifiques à l'environnement d'exécution qui sont incompatibles entre les deux systèmes, qui sont facilement inclus lorsque le mauvais compilateur est utilisé. De plus, les compilateurs cygwin contiennent des patchs différents des compilateurs de mingw.

+0

Donc, il serait possible d'utiliser CodeBlocks + gnugcc (mingw) + Festival? Ou je dois le compiler avec Cygwin? Je ne peux pas utiliser un IDE? – legami

+0

Vous pouvez définir le compilateur cygwin dans la boîte de dialogue globale "Paramètres du débogueur de l'annonce du compilateur". Lorsque vous ne souhaitez pas définir le compilateur pour chaque projet, vous pouvez également utiliser CMake pour générer les fichiers de contrôle IDE. – Rudi

+0

Merci @Rudi. Eh bien, j'ai changé les options de construction du projet, et maintenant le compilateur est cygwin. J'ai ceci: -------------- Construire: Debug dans ejecutable --------------- Compiling: main.cpp Exécution de 'g ++. Exe -Wall -fexceptions -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 'dans' C: \ 0621 \ source \ build \ ejecutable 'a échoué. Rien à faire. – legami

Questions connexes