Nominate our 2022 Qt Champions!

Qprocess Not working for MAC OSX

  • Hello,
    I am trying to run lastfm fingerprint commandline tool with my qt application using qprocess. I download two different tool one for windows(lastfmfpclient.exe) and other for MAC ( with libs). Window tool is working on windows CMD as well as in Qt but MAC tool only working in Terminal but not working in Qt. can anyone have any idea about this.
    Terminal Code.

    @MachMachine-iMac:~ tech$ cd /Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel\ 2/
    MachMachine-iMac:lastfm.fpclient.beta2.OSX-intel 2 tech$ ./lastfmfpclient -url /Users/tech/ffmpegcommandline/a.mp3
    TagLib: String::prepare() - Invalid UTF16 string.
    This code give me the path of a xml file which i need.@

    Qt Code :
    I want same result in Qt by using qprocess but this is not working.

    @QString lastfmHandler::getFingerprintURL(QString trackPath)
    QProcess getURL;
    QString ToolName;

    #ifdef Q_OS_MAC
    ToolName="/Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel 2/";
    QStringList passArgument;
    QString output=getURL.readAllStandardOutput();
    return output;



    Take lastfm client code from "here":
    Can some one have any idea how to work this code.
    Thanks in advance

  • Moderators

    Try it with this change:
    passArgument<<"-url /Users/tech/ffmpegcommandline/a.mp3";

    Or even put the whole line (invocation + all arguments) into the ToolName variable.

  • Hello Sierdzio
    I try this but this also not working any other way.

  • Moderators

    You can try using QDesktopServices or running "open" through QProcess.

    But, to get it working in QProcess like you are trying to, you need to get into the app bundle ("/Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel 2/").

Log in to reply