how to include qjsonrpc.pri properly?

Issue #17 resolved
Victor Sklyar created an issue

I want make simple project with static build of qjsonrpc.

What I have

qjsonrpc-test
  qjsonrpc\
    .git
    ...
  main.cpp
  main.pro

--- main.pro ---
DEFINES += QJSONRPC_LIBRARY_TYPE=staticlib
include(qjsonrpc\qjsonrpc.pri)

SOURCES += main.cpp

--- main.cpp ---
#include <QtCore>

#include "qjsonrpcmessage.h"
#include "qjsonrpchttpclient.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QJsonRpcHttpClient client;
    //...

    return a.exec();
}

It is doesn't work... Can you give me such skeleton?

Comments (8)

  1. Victor Sklyar reporter

    please see my test project but i think it is not elegant way because using .qmake.cache

    So, howto remake test/manual/httpclient to simple qjsonrpc-test file structure?

  2. Matt Broadstone

    @vinnitu qjsonrpc isn't really meant to be used as a static lib (licensing issues), but if you want to do that, then you don't want to use qjsonrpc.pri directly. Instead, you would follow these steps:

    • go into the qjsonrpc folder and build with the QJSONRPC_LIBRARY_TYPE="staticlib", generating a libqjsonrpc.a

    • copy that libqjsonrpc.a to your project

    • then in your pro file you will want to add a "INCLUDEPATH += /path/to/qjsonrpc/src" folder, and add "-L/path/to/qjsonrpc.a/folder -lqjsonrpc" to your pro file

  3. Victor Sklyar reporter

    I see. And it works to but not user friendly ) I need it only for test case but in general I think it not bad if works out of box.

    In any case Thank You!

  4. Log in to comment