【发布时间】:2013-07-21 22:52:57
【问题描述】:
嗨,我一直在尝试让我的 c++ 程序在 Linux GCC 上工作 我使用了一个名为 Festival 2.1 的文本转语音库
<code>
#include<iostream>
#include<stdlib.h>
#include<festival/festival.h>
using namespace std;
int main()
{
int heap_size=210000;
int load_init_files=1;
festival_initialize(load_init_files,heap_size);
festival_say_text("Hi dude, how are you ?");
festival_wait_for_spooler();
return 0;
}
</code>
这是我的程序。 g++ test.cpp -l Festival -I/usr/include/festival -I/usr/lib/speech_tools/include -leststring -lestools -lestbase 使用它我能够成功编译并可以创建 exec。
但是,我如何在 Eclipse CDT(ubuntu 11.10)中设置环境变量等以使用此代码工作.. 现在我得到了错误
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:21: 未定义引用festival_initialize(int, int)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:22: undefined reference toEST_String::EST_String(char const*)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:22: 未定义引用festival_say_text(EST_String const&)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:23: undefined reference tofestival_wait_for_spooler()'
./src/test.o: 在函数EST_Chunk::operator--()':
/usr/include/speech_tools/EST_Chunk.h:140: undefined reference toEST_Chunk::~EST_Chunk()'
/usr/include/speech_tools/EST_Chunk.h:140:未定义对“EST_Chunk::operator delete(void*)”的引用
collect2: ld 返回 1 个退出状态
make: * [LBOT] 错误 1
【问题讨论】:
标签: c++ linux ubuntu-11.10 festival