I'm trying to compile the QT Bitcoin Trader using the following code:
qtBitcoinTrader.cpp
void QtBitcoinTrader::sayText(QString text)
{
Q_UNUSED(text)
#ifdef Q_OS_MAC
static SpeechChannel voiceChannel;
static bool once=true;
if(once)
{
once=false;
NewSpeechChannel((VoiceSpec*)NULL, &voiceChannel);
}
CFStringRef talkText=CFStringCreateWithCharacters(0,reinterpret_cast<const UniChar *>(text.unicode()), text.length());
SpeakCFString(voiceChannel, talkText, NULL);
CFRelease(talkText);
#else
#ifdef Q_OS_WIN
#ifdef SAPI_ENABLED
static ISpVoice *pVoice=NULL;
static HRESULT hr=CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
if(SUCCEEDED(hr))
{
pVoice->Speak(NULL,SPF_PURGEBEFORESPEAK,0);
pVoice->Speak((LPCWSTR)text.utf16(), SPF_ASYNC, NULL);
}
#endif
#else
startApplication("say",QStringList()<<text);
#endif
#endif
}
When I compile the code, I get the following error:
Undefined symbols for architecture x86_64:
"_CFRelease", referenced from:
QtBitcoinTrader::sayText(QString) in qtbitcointrader.o
"_CFStringCreateWithCharacters", referenced from:
QtBitcoinTrader::sayText(QString) in qtbitcointrader.o
"_NewSpeechChannel", referenced from:
QtBitcoinTrader::sayText(QString) in qtbitcointrader.o
"_SpeakCFString", referenced from:
QtBitcoinTrader::sayText(QString) in qtbitcointrader.o
"_inflate", referenced from:
JulyHttp::uncompress(QByteArray*) in julyhttp.o
"_inflateEnd", referenced from:
JulyHttp::uncompress(QByteArray*) in julyhttp.o
"_inflateInit2_", referenced from:
JulyHttp::uncompress(QByteArray*) in julyhttp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [DemoProject.app/Contents/MacOS/DemoProject] Error 1
03:03:20: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project DemoProject (kit: Desktop Qt 5.6.0 clang 64bit)
When executing step "Make"
How to solve this error?