如何使用g ++在C ++程序中链接festival TTS库

时间:2010-05-17 05:36:48

标签: c++ g++ text-to-speech festival

我正在使用Festival c ++ Api,但在

提供的手册中

http://www.cstr.ed.ac.uk/projects/festival/manual/festival_28.html#SEC132

说连接festival / src / lib / libFestival.a等。 所以请告诉我如何将它们与我的c ++程序联系起来

2 个答案:

答案 0 :(得分:1)

从g ++链接静态库的最简单方法是使用完整路径在命令行上命名库:

g++ mycode.cpp -o myprog /myinstall/festival/src/lib/libFestival.a

其中/ myinstall是您安装库的地方。您还可以使用-L和-l标志指定路径和库:

g++ mycode.cpp -o myprog -L/myinstall/festival/src/lib -lFestival

答案 1 :(得分:0)

我假设您将file.cpp放在包含从包中提取的festival和speech_tools的目录中。

编译:

g ++ yourFile.cpp -o yourFile -I./festival/src/include -I./speech_tools/include -L./festival/src/lib -lFestival -L./speech_tools/lib/-lestools -lestbase - leststring