0

I am currently trying to compile this basic festival program

#include <iostream>
#include <festival/festival.h>

#define HEAP_SIZE 210000
#define LOAD_INIT_FILES 1

using namespace std;


int main()
{
    festival_initialize(LOAD_INIT_FILES, HEAP_SIZE);

    festival_say_text("Hello World");

    festival_wait_for_spooler();

    return 0;
}

When I try to build the program with g++, I get these errors:

speech_tools/lib/libestools.a $USER/Downloads/festival/speech_tools/lib/libeststring.a
$USER/Downloads/festival/speech_tools/lib/libestools.a(EST_PST.o): In function `EST_PredictionSuffixTree::test(EST_String)':
EST_PST.cc:(.text+0x2d30): undefined reference to `confusion(EST_TKVL<EST_String, EST_String>&, EST_TList<EST_String>&)'
EST_PST.cc:(.text+0x2d40): undefined reference to `print_confusion(EST_FMatrix const&, EST_TKVL<EST_String, EST_String>&, EST_TList<EST_String>&)'
$USER/Downloads/festival/speech_tools/lib/libestools.a(wfst_ops.o): In function `EST_WFST::determinize(EST_WFST const&)':
wfst_ops.cc:(.text+0x1136): undefined reference to `EST_THash<int, int>::EST_THash(int, unsigned int (*)(int const&, unsigned int))'
wfst_ops.cc:(.text+0x1206): undefined reference to `EST_THash<int, int>::val(int const&, int&) const'
wfst_ops.cc:(.text+0x122f): undefined reference to `EST_THash<int, int>::add_item(int const&, int const&, int)'
wfst_ops.cc:(.text+0x1568): undefined reference to `EST_THash<int, int>::~EST_THash()'
wfst_ops.cc:(.text+0x17d8): undefined reference to `EST_THash<int, int>::~EST_THash()'
$USER/Downloads/festival/speech_tools/lib/libestools.a(editline.o): In function `readline':
editline.c:(.text+0x7d2a): undefined reference to `tgetent'
editline.c:(.text+0x7d85): undefined reference to `tgetstr'
editline.c:(.text+0x7d9d): undefined reference to `tgetstr'
editline.c:(.text+0x7db5): undefined reference to `tgetstr'
editline.c:(.text+0x7dcd): undefined reference to `tgetstr'
editline.c:(.text+0x7e65): undefined reference to `tgetstr'
editline.c:(.text+0x7e87): undefined reference to `tgetnum'
editline.c:(.text+0x7e99): undefined reference to `tgetnum'
editline.c:(.text+0x7f21): undefined reference to `tgetstr'
collect2: error: ld returned 1 exit status

As per http://festvox.org/docs/manual-2.4.0/festival_28.html#C_002fC_002b_002b-API, I added festival/src/include and speech_tools/include to the search path, in addition to linking with festival/src/lib/libFestival.a, speech_tools/lib/libestools.a, speech_tools/lib/libestbase.a, and speech_tools/lib/libeststring.a.

I am trying to build this on Arch Linux with g++ and festival 2.4.0.

EDIT: Build command I'm using is

g++ -o bin/Debug/festival_test obj/Debug/main.o /usr/lib/libcurl.so /home/joshua/Downloads/festival/festival/src/lib/libFestival.a /home/joshua/Downloads/festival/speech_tools/lib/libestbase.a /home/joshua/Downloads/festival/speech_tools/lib/libestools.a /home/joshua/Downloads/festival/speech_tools/lib/libeststring.a

I am using CodeBlocks so this is the default build command

EDIT 2: Adding -lncurses to the build command eliminated the undefined reference errors relating to readline, but the other errors still persist

/home/joshua/Downloads/festival/speech_tools/lib/libestools.a(EST_PST.o): In function `EST_PredictionSuffixTree::test(EST_String)':
EST_PST.cc:(.text+0x2d30): undefined reference to `confusion(EST_TKVL<EST_String, EST_String>&, EST_TList<EST_String>&)'
EST_PST.cc:(.text+0x2d40): undefined reference to `print_confusion(EST_FMatrix const&, EST_TKVL<EST_String, EST_String>&, EST_TList<EST_String>&)'
/home/joshua/Downloads/festival/speech_tools/lib/libestools.a(wfst_ops.o): In function `EST_WFST::determinize(EST_WFST const&)':
wfst_ops.cc:(.text+0x1136): undefined reference to `EST_THash<int, int>::EST_THash(int, unsigned int (*)(int const&, unsigned int))'
wfst_ops.cc:(.text+0x1206): undefined reference to `EST_THash<int, int>::val(int const&, int&) const'
wfst_ops.cc:(.text+0x122f): undefined reference to `EST_THash<int, int>::add_item(int const&, int const&, int)'
wfst_ops.cc:(.text+0x1568): undefined reference to `EST_THash<int, int>::~EST_THash()'
wfst_ops.cc:(.text+0x17d8): undefined reference to `EST_THash<int, int>::~EST_THash()' 

EDIT 3: Setting libestbase to link last fixed the error.

1 Answers1

0

It may be related to this bug report: https://bugzilla.redhat.com/show_bug.cgi?id=499837

It suggests that you explicitly link in the ncurses library for the readline library that seems to be included by another of your libraries. So you would add:

-lncurses

to your command.

pcarter
  • 1,516
  • 14
  • 21
  • Added -lncurses to the build, eliminated all readline errors but I still get the other undefined reference errors – Mike Stache Nov 13 '17 at 22:12