gpt4 book ai didi

c++ - Festival C/C++ API编译实例,链接库报错

转载 作者:行者123 更新时间:2023-11-30 03:10:31 25 4
gpt4 key购买 nike

我在使用节日 C++ API (Windows XP) 时遇到问题。

在我成功制作 festival 和 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) 我输入:

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\source\build

里面有文件夹\festival\和\speech_tools\

:)

最佳答案

将 -lib* 替换为 -l*。
例如 -libFestival 将不起作用。做

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

关于c++ - Festival C/C++ API编译实例,链接库报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3100095/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com