1

こんにちは、Linux GCC で動作する C++ プログラムを作成しようとしています。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)でenv変数などを設定するにはどうすればよいですか..今、エラーが発生しています

festival_initialize(int, int)' /home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:22: undefined reference to/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:21: EST_String::EST_String(char const*)への未定義の参照' /home/gp/WORKSPACE-CDT/LBOT/Debug/ ../src/test.cpp:22: festival_wait_for_spooler() への未定義の参照festival_say_text(EST_String const&)' /home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:23: undefined reference to' ./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

4

1 に答える 1

2

私はこれに対する解決策を見つけました。したがって、Festival tts の実行中に同じ問題が発生した場合は、それが役立ちます :) 基本的に、環境フラグと変数は、プロジェクト プロパティとツールチェーン設定の変更を介して Eclipse で設定できます。手順: UBUNTU 11.10

GCC 4.x プリインストール

端末コマンドを使用して Elipse CDT をインストールしました

以下を使用して Eclipse で構成された pthreads: project->preferences->c/c++ build/settings->GCC linker-> library vars add "pthreads"

以下を使用してインストールされたフェスティバル: sudo apt-get install festival

Festival dev を使用してインストール: sudo apt-get install festival-dev festvox-don build-essential g++

未解決の包含エラー: goto eclipse、project->preferences->c/c++ build/settings および c,c++,linker ディレクトリへの festival,speech_tools パスの追加

#include<stdio.h>

#include<festival.h>

int main(int argc,char **argv)

{

int heap_size=210000;

int load_init_files=1;

festival_initialize(load_init_files,heap_size);

festival_say_text("it is lunch time");

festival_wait_for_spooler();

return 0;

}

ターミナル

sudo g++ main.cpp -l Festival -I/usr/include/festival  -I/usr/lib/speech_tools/include -l eststring -l estools -l estbase -o nat.out

日食

project->preferences->c/c++ build/settings->GCC linker-> library vars add 'Festival'

project->preferences->c/c++ build/settings->GCC linker-> library vars add 'eststring'

project->preferences->c/c++ build/settings->GCC linker-> library vars add 'estools'

project->preferences->c/c++ build/settings->GCC linker-> library vars add 'estbase'

于 2013-08-01T14:26:48.050 に答える