节日 C/C++ API编译示例,链接库错误

发布于 2024-09-07 01:12:06 字数 1445 浏览 3 评论 0原文

我在使用 Festival 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\

:)

I am having problems with the festival C++ API (Windows XP).

After I make both festival and speech_tools succesfully (Cygwin), I have a file, called festival_example.cc, which contains:

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

Then (Cygwin) I type:

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

It cannot find the libraries.
If I write -I/cygdrive/c/0621/source/build/festival/src/include and the same in all, the error persists.

I have my program in

C:\0621\source\build

And inside I have the folders \festival\ and \speech_tools\

:)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

猫烠⑼条掵仅有一顆心 2024-09-14 01:12:07

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

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

Replace -lib* with -l*.
For instance -libFestival won't work. Do

g++ festival_example.cc -I./festival/src/include  -I./speech_tools/include -L./festival/src/lib -lFestival
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文