referência indefinida para função de espeak

0

depois de digitar make para compilar um projeto que depende do erro Eu tenho o seguinte erro no estágio de vinculação

     'EspeakTTSWorker.cpp:(.text+0x118): undefined reference to 'espeak_Initialize'
CMakeFiles/TextReading.dir/EspeakBridge.cpp.o: In function 'EspeakBridge::init()':
EspeakBridge.cpp:(.text+0x93): undefined reference to 'espeak_Initialize'
EspeakBridge.cpp:(.text+0x9d): undefined reference to 'espeak_SetVoiceByName'
EspeakBridge.cpp:(.text+0xa7): undefined reference to 'espeak_SetSynthCallback'
CMakeFiles/TextReading.dir/EspeakBridge.cpp.o: In function 'EspeakBridge::close()':
EspeakBridge.cpp:(.text+0x173): undefined reference to 'espeak_Terminate'
CMakeFiles/TextReading.dir/EspeakBridge.cpp.o: In function 'EspeakTTSWorker::setText(std::string const&)':
EspeakBridge.cpp:(.text._ZN15EspeakTTSWorker7setTextERKSs[_ZN15EspeakTTSWorker7setTextERKSs]+0x121): undefined reference to 'espeak_Synth'
EspeakBridge.cpp:(.text._ZN15EspeakTTSWorker7setTextERKSs[_ZN15EspeakTTSWorker7setTextERKSs]+0x126): undefined reference to 'espeak_Synchronize'
collect2: error: ld returned 1 exit status
make[2]: *** [TextReading] Error 1
make[1]: *** [CMakeFiles/TextReading.dir/all] Error 2
make: *** [all] Error 2'

e aqui está cmakelisits

    find_package (Espeak)
if (Espeak_FOUND)
include_directories(${Espeak_INCLUDE_DIRS})  #/usr/local/include/espeak
endif(Espeak_FOUND)
if (NOT Espeak_Found)
message(FATAL_ERROR "Package Espeak required, but not found!")
endif(NOT Espeak_Found)
add_executable(TextReading
        ${DAD_SOURCES}
        ${DAD_HEADERS}
        ${MY_UI_HDRS}
        ${MY_MOC_SRCS}
    ${MY_CUDA_COMPILED_FILES}
    ${QEXTSERIALPORT_SOURCES} ${QEXTSERIALPORT_HEADERS}
    )


target_link_libraries(TextReading
        ${OpenGL_LIBS}
        ${QT_LIBRARIES}
        ${QGLVIEWER}
    ${Boost}
    ${OpenCV_LIBS}
        ${TESSERACT_LIB}
    ${FFMPEG_LIBRARIES}
    ${MathGL_LIB}
   # ${Flite_LIBS}
   ${Espeak_LIBRARIES}
#/usr/lib/x86_64-linux-gnu/libespeak.so.1
#/usr/lib/x86_64-linux-gnu/libespeak.so.1.1.47
    ${QEXTSERIALPORT_LIBS}
    ${QTMOBILITY_LIBRARIES}
    udev

)

dica: eu coloquei o arquivo FindEspeak.cmake no caminho do módulo do cmake

    
por Hamdy Fouad 12.07.2016 / 16:56

1 resposta

0

Acabei de editar esta parte

############ Find ESPEAK TTS ############ 

find_path(LIBESPEAK_INCLUDE_DIRS 
          NAMES speak_lib.h
          HINTS /usr/include/espeak)
find_library(LIBESPEAK_LIBRARIES
             NAMES espeak
             HINTS /usr/lib/ /usr/x86_64-linux-gnu/
             PATH_SUFFIXES lib)

######################################## 


add_executable(TextReading 
        ${DAD_SOURCES} 
        ${DAD_HEADERS} 
        ${MY_UI_HDRS} 
        ${MY_MOC_SRCS} 
    ${MY_CUDA_COMPILED_FILES} 
    ${QEXTSERIALPORT_SOURCES} ${QEXTSERIALPORT_HEADERS} 
    ) 


target_link_libraries(TextReading 
        ${OpenGL_LIBS} 
        ${QT_LIBRARIES} 
        ${QGLVIEWER} 
    ${Boost} 
    ${OpenCV_LIBS} 
        ${TESSERACT_LIB} 
    ${FFMPEG_LIBRARIES} 
    ${MathGL_LIB} 
    #${ESPEAK_LIBRARIES}
    ${LIBESPEAK_LIBRARIES} 
    ${QEXTSERIALPORT_LIBS} 
    ${QTMOBILITY_LIBRARIES} 
    udev 

) 
    
por Hamdy Fouad 17.07.2016 / 14:36