Answer the question
In order to leave comments, you need to log in
How to fix undefined reference to existing function?
Hello! I've been writing in c++ for quite some time now. Trying to compile
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <RHVoice/core/engine.hpp>
#include <RHVoice/core/document.hpp>
#include <RHVoice/core/client.hpp>
#include <RHVoice/RHVoice.h>
#include <RHVoice/RHVoice_common.h>
using namespace std;
using namespace RHVoice;
int main(int argc, char **argv){
RHVoice_init_params tts_params;
RHVoice_tts_engine tts = RHVoice_new_tts_engine(&tts_params);
cout << RHVoice_get_voices(tts) << endl;
return 0;
}
g++ -I/usr/local/include/utf8 -I/usr/local/include/rapidxml -I/usr/local/include/RHVoice -I/usr/local/include -o main main.cpp
/tmp/ccAMF2oc.o: In function `main':
main.cpp:(.text+0x17): undefined reference to `RHVoice_new_tts_engine'
main.cpp:(.text+0x27): undefined reference to `RHVoice_get_voices'
collect2: error: ld returned 1 exit status
Answer the question
In order to leave comments, you need to log in
main.cpp:(.text+0x17): undefined reference to `RHVoice_new_tts_engine'
main.cpp:(.text+0x27): undefined reference to `RHVoice_get_voices'
-L/usr/local/lib -lRHVoice
. To find out for sure, you need to look where the RHVoice library (*.a or *.so) is installed and what it is called.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question