- edited description
how to include qjsonrpc.pri properly?
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)
-
reporter -
It is not a bug. There is google groupe for such questions: qjsonrpc-development
-
There is httpclient example in tests/manual.
-
reporter - attached qjsonrpc-test.tar.gz
-
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?
-
@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
-
-
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!
-
- changed status to resolved
- Log in to comment