title: How to install QJson in Qt creator (Qt 4.8.6)
body: <p>I want to use QJson in Qt creator.  I'm using Qt 4.8.6 so there is no Json lib in the QtCore like in Qt5.</p>
  
  <p>I have been to the sourceforge site: <a href="http://qjson.sourceforge.net/build/" rel="nofollow">http://qjson.sourceforge.net/build/</a> and it says that I should install qjson using package manage tools. So I installed <em>libqjson0, libqjson-dev, libqjson-dbg and libqjson0-dbg</em> package using apt-get install. </p>
  
  <p>Than I created a new project and copy the official site's example to it. I alse modified my .pro file, I added an external library (<em>libqjson.so</em>) so Qt creator automatically added the following code to the .pro file:</p>
  
  <p><code>win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../usr/lib/x86_64-linux-gnu/release/ -lqjson
  else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../usr/lib/x86_64-linux-gnu/debug/ -lqjson
  else:unix: LIBS += -L$$PWD/../../../../../../usr/lib/x86_64-linux-gnu/ -lqjson
  INCLUDEPATH += $$PWD/../../../../../../usr/lib/x86_64-linux-gnu
  DEPENDPATH += $$PWD/../../../../../../usr/lib/x86_64-linux-gnu</code></p>
  
  <p>The <em>libqjson.so</em> file is in the <em>x86_64-linux-gnu</em> path.
  I also added a line including the parse.h file and other files with it:
  <code>INCLUDEPATH += $$PWD/../../../../../../usr/include/qjson</code></p>
  
  <p>After that, I can include , but I can't use the function like <em>toMap(), toString()</em> in my code...</p>
  
  <p>I think there must be something wrong in my install procedure.  Here is my code:</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
      QJson::Parser parser;
      bool ok;
  
      QString json;
      json = "{\"encoding\" : \"UTF-8\",\"plug-ins\": [\"python\",\"c++\", \"ruby\"],\"indent\":{\"length\": 3,\"use_space\":true}}";
  
      QVariantMap result = parser.parse(json, &amp;ok).toMap();
      if (!ok) {
        qFatal("An error occurred during parsing");
        exit (1);
      }
  
      qDebug() &lt;&lt; "encoding:" &lt;&lt; result["encoding"].toString();
      qDebug() &lt;&lt; "plugins:";
  
      foreach (QVariant plugin, result["plug-ins"].toList()) {
        qDebug() &lt;&lt; "\t-" &lt;&lt; plugin.toString();
      }
  
      QVariantMap nestedMap = result["indent"].toMap();
      qDebug() &lt;&lt; "length:" &lt;&lt; nestedMap["length"].toInt();
      qDebug() &lt;&lt; "use_space:" &lt;&lt; nestedMap["use_space"].toBool();
      QApplication a(argc, argv);
      QJsons w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>And this is my error information:</p>
  
  <p>08:40:53: Running steps for project QJson...
  08:40:53: Configuration unchanged, skipping qmake step.
  08:40:53: Starting: "/usr/bin/make" 
  /usr/local/Trolltech/Qt-4.8.6/bin/qmake -spec /usr/local/Trolltech/Qt-4.8.6/mkspecs/linux-g++ CONFIG+=debug -o Makefile ../QJson/QJson.pro
  g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/Qt-4.8.6/mkspecs/linux-g++ -I../QJson -I/usr/local/Trolltech/Qt-4.8.6/include/QtCore -I/usr/local/Trolltech/Qt-4.8.6/include/QtGui -I/usr/local/Trolltech/Qt-4.8.6/include -I/home/cecaadmin/GRT/QtProjects/TranferFileDemo/QJson/../../../usr/include/qjson -I/usr/include/qjson -I. -I../QJson -I. -o main.o ../QJson/main.cpp</p>
  
  <p>../QJson/main.cpp: In function 'int main(int, char**)':</p>
  
  <p>../QJson/main.cpp:13:48: error: no matching function for call to </p>
  
  <p>'QJson::Parser::parse(QString&amp;, bool*)'
       QVariantMap result = parser.parse(json, &amp;ok).toMap();
                                                  ^
  ../QJson/main.cpp:13:48: note: candidates are:
  In file included from ../QJson/main.cpp:4:0:
  /usr/include/qjson/parser.h:51:16: note: QVariant QJson::Parser::parse(QIODevice*, bool*)
         QVariant parse(QIODevice* io, bool* ok = 0);
                  ^
  /usr/include/qjson/parser.h:51:16: note:   no known conversion for argument 1 from 'QString' to 'QIODevice*'
  /usr/include/qjson/parser.h:61:16: note: QVariant QJson::Parser::parse(const QByteArray&amp;, bool*)
         QVariant parse(const QByteArray&amp; jsonData, bool* ok = 0);
                  ^
  /usr/include/qjson/parser.h:61:16: note:   no known conversion for argument 1 from 'QString' to 'const QByteArray&amp;'
  ../QJson/main.cpp:19:12: error: invalid use of incomplete type 'class QDebug'
       qDebug() &lt;&lt; "encoding:" &lt;&lt; result["encoding"].toString();
              ^
  In file included from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qnamespace.h:45:0,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qobjectdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwindowdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwidget.h:46,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/QWidget:1,
                   from ../QJson/qjsons.h:4,
                   from ../QJson/main.cpp:1:</p>
  
  <p>/usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1793:7: error: forward declaration of 'class QDebug'
   class QDebug;
         ^</p>
  
  <p>../QJson/main.cpp:20:12: error: invalid use of incomplete type 'class QDebug'
       qDebug() &lt;&lt; "plugins:";
              ^
  In file included from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qnamespace.h:45:0,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qobjectdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwindowdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwidget.h:46,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/QWidget:1,
                   from ../QJson/qjsons.h:4,
                   from ../QJson/main.cpp:1:</p>
  
  <p>/usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1793:7: error: forward declaration of 'class QDebug'
   class QDebug;
         ^</p>
  
  <p>../QJson/main.cpp:23:14: error: invalid use of incomplete type 'class QDebug'
         qDebug() &lt;&lt; "\t-" &lt;&lt; plugin.toString();
                ^
  In file included from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qnamespace.h:45:0,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qobjectdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwindowdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwidget.h:46,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/QWidget:1,
                   from ../QJson/qjsons.h:4,
                   from ../QJson/main.cpp:1:</p>
  
  <p>/usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1793:7: error: forward declaration of 'class QDebug'
   class QDebug;
         ^</p>
  
  <p>../QJson/main.cpp:27:12: error: invalid use of incomplete type 'class QDebug'
       qDebug() &lt;&lt; "length:" &lt;&lt; nestedMap["length"].toInt();
              ^
  In file included from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qnamespace.h:45:0,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qobjectdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwindowdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwidget.h:46,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/QWidget:1,
                   from ../QJson/qjsons.h:4,
                   from ../QJson/main.cpp:1:</p>
  
  <p>/usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1793:7: error: forward declaration of 'class QDebug'
   class QDebug;
         ^</p>
  
  <p>../QJson/main.cpp:28:12: error: invalid use of incomplete type 'class QDebug'
       qDebug() &lt;&lt; "use_space:" &lt;&lt; nestedMap["use_space"].toBool();
              ^
  In file included from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qnamespace.h:45:0,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qobjectdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwindowdefs.h:45,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/qwidget.h:46,
                   from /usr/local/Trolltech/Qt-4.8.6/include/QtGui/QWidget:1,
                   from ../QJson/qjsons.h:4,
                   from ../QJson/main.cpp:1:</p>
  
  <p>/usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1793:7: error: forward declaration of 'class QDebug'
   class QDebug;
         ^
  /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h: At global scope:
  /usr/local/Trolltech/Qt-4.8.6/include/QtCore/qglobal.h:1796:29: warning: inline function 'QDebug qDebug()' used but never defined [enabled by default]
   Q_CORE_EXPORT_INLINE QDebug qDebug();
                               ^
  make: *** [main.o] Error 1
  08:40:54: The process "/usr/bin/make" exited with code 2.
  Error while building/deploying project QJson (kit: Desktop)
  When executing step 'Make'</p>