如何在C++;使用g++; 我使用节日C++ API,但在

如何在C++;使用g++; 我使用节日C++ API,但在,c++,g++,text-to-speech,festival,C++,G++,Text To Speech,Festival,说链接festival/src/lib/libFestival.a等。 请告诉我,把它们与我的C++程序 链接。把一个静态库与g++连接起来的最简单的方法就是用命令行命名库,使用完整路径: g++ mycode.cpp -o myprog /myinstall/festival/src/lib/libFestival.a where/myinstall是安装库的位置。还可以使用-L和-L标志指定路径和库: g++ mycode.cpp -o myprog -L/myinstall/festiv

说链接festival/src/lib/libFestival.a等。
请告诉我,把它们与我的C++程序

链接。把一个静态库与g++连接起来的最简单的方法就是用命令行命名库,使用完整路径:

g++ mycode.cpp -o myprog /myinstall/festival/src/lib/libFestival.a
where/myinstall是安装库的位置。还可以使用-L和-L标志指定路径和库:

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

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

g++ mycode.cpp -o myprog /myinstall/festival/src/lib/libFestival.a
where/myinstall是安装库的位置。还可以使用-L和-L标志指定路径和库:

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

我假设您将file.cpp放在包含festival和speech_工具的目录中,这些工具是从包中提取的

汇编:


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

我假设您将文件.cpp放在包含从包中提取的festival和speech_工具的目录中

汇编:

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