Can not find sayText method in QtBitcoinTrader

0 votes

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?

Aug 30, 2018 in Blockchain by digger
• 26,740 points
755 views

1 answer to this question.

0 votes

You've not added the ApplicationServices and CoreFoundation frameworks to your build, and you're missing the system libz too. Add the following to the .pro file, then re-run qmake and build again:

LIBS += -framework ApplicationServices -framework CoreFoundation -lz

This should solve your error

answered Aug 30, 2018 by slayer
• 29,370 points

Related Questions In Blockchain

0 votes
1 answer

Can not make a peer in Hyperledger Fabric

You have not installed jdk on your system. ...READ MORE

answered Nov 22, 2018 in Blockchain by Omkar
• 69,220 points
618 views
0 votes
1 answer

Private ethereum network can not find geth.ipc

If you have initialized the genesis block ...READ MORE

answered Dec 6, 2018 in Blockchain by Omkar
• 69,220 points
2,632 views
0 votes
1 answer
+1 vote
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured ...READ MORE

answered Aug 6, 2018 in Blockchain by aryya
• 7,460 points
1,428 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,923 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
0 votes
1 answer

why are permissions not stored in blockchain?

When a channel is created, the configurations ...READ MORE

answered Jul 10, 2018 in Blockchain by slayer
• 29,370 points
683 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP