I’ve successfully(?) installed the QJson library following the instructions in the archive. But the compiler gives me this error:
Undefined reference to QJSon::Parser::Parser().
I’ve found where library files have been installed: it’s /usr/local/include/json directory. But there are only *.h files in it.
The minimal code:
main.cpp
#include <QtGui/QApplication>
#include <qjson/parser.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QJson::Parser parser;
return a.exec();
}
I use linux.
Where are *.cpp files? What did I do wrong? Why isn’t the library complete?
At first you have to find a library file rather than a
*.cppfile. Maybe ithas a name like
"libqjson.a"or"libqjson.so"and compile this library with your code or pass this keys toAs it turned out (see comments below), your library path is
/usr/local/lib, so this line becomes:Using Qt (qmake), just add this line to your
.profile in order to pass these two flags to g++: