2010-06-23 52 views
1

我遇到節日C++ API(Windows XP)的問題。節日C/C++ API編譯示例,鏈接庫錯誤

我使這兩個節日,speech_tools成功地(Cygwin的)之後,我有一個文件,叫做festival_example.cc,其中包含:

#include <stdio.h> 
#include <festival.h> 

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

然後(Cygwin的)I型:

g++ festival_example.cc -I./festival/src/include -I./speech_tools/include -L./festival/src/lib -libFestival -L./speech_tools/lib -libestools -libestbase -libeststring 

它無法找到這些庫。 如果我寫-I/cygdrive/c/0621/source/build/festival/src/include並且所有內容相同,則錯誤仍然存​​在。

我有我的

C程序:\ 0621 \源\建立

而且裏面有我的文件夾\節\和\ speech_tools \

:)

+0

http://stackoverflow.com/questions/2846858/how-to-link-festival-tts-libraries-in-a-c-programme-using-g – log0 2010-06-23 08:43:08

回答

3

替換 - lib *與-l *。
例如-libFestival不起作用。做

g++ festival_example.cc -I./festival/src/include -I./speech_tools/include -L./festival/src/lib -lFestival 
+0

由於它的工作原理。但是現在我有新的錯誤! 很多未發現的引用... _tgetstr ...等。 在libFestival.a和libestools.a中。想法? – legami 2010-06-23 09:23:43