Reputation: 198
Hi i have been trying to make a c++ program of mine to work on Linux GCC I have used a Text to speech lib called 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>
This is my program. g++ test.cpp -l Festival -I/usr/include/festival -I/usr/lib/speech_tools/include -leststring -lestools -lestbase Using this i am able to compile successfully and exec could be created.
But, how do i set env variables etc in Eclipse CDT(ubuntu 11.10) to work using this code .. Now i am getting the error
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:21: undefined reference to festival_initialize(int, int)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:22: undefined reference to
EST_String::EST_String(char const*)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:22: undefined reference to festival_say_text(EST_String const&)'
/home/gp/WORKSPACE-CDT/LBOT/Debug/../src/test.cpp:23: undefined reference to
festival_wait_for_spooler()'
./src/test.o: In function EST_Chunk::operator--()':
/usr/include/speech_tools/EST_Chunk.h:140: undefined reference to
EST_Chunk::~EST_Chunk()'
/usr/include/speech_tools/EST_Chunk.h:140: undefined reference to `EST_Chunk::operator delete(void*)'
collect2: ld returned 1 exit status
make: * [LBOT] Error 1
Upvotes: 1
Views: 1721
Reputation: 198
i found the solution to this. So if anyone gets the same problem running Festival tts, it can help :) basically the environment flags and variables can be set in eclipse through project properties and changing the toolchain settings STEPS: UBUNTU 11.10
GCC 4.x pre-installed
Elipse CDT was installed using terminal command
pthreads configured in eclipse using: project->preferences->c/c++ build/settings->GCC linker-> library vars add "pthreads"
Festival installed using: sudo apt-get install festival
Festival dev installed using: sudo apt-get install festival-dev festvox-don build-essential g++
Unresolved inclusion error: goto eclipse, project->preferences->c/c++ build/settings and add festival,speech_tools path to c,c++,linker directories
#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;
}
TERMINAL
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
ECLIPSE
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'
Upvotes: 2