3

How do I refernce the qjson.dll file from one of qt project?

For eg :C:\qjson-0.7.1\qjson\build\lib , in this location, I have qjson.dll and qjson.dll.a file. I want to use that dll from my qt project.How should I point to that location in that .pro file. I can't compile successful, the error that I got is C:/QTTest/foo/foo/main.cpp:6: error: Qjson/parser.h: No such file or directory .Can someone can help me?

Thx.

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
Chris
  • 61
  • 2
  • 3

1 Answers1

5

First, you have to tell QMake in your .pro where is located your header files using the INCLUDEPATH variable (please correct the path to point the location of your Qjson folder):

INCLUDEPATH += "c:/qjson-0.7.1/include"

Second, you must specify your library and it's location using LIBS variable:

LIBS += "c:/qjson-0.7.1/qjson/build/lib/qjson.dll.a"

Now, QMake will find your header file and your library. You will need to have the qjson.dll in the same directory as your Qt application or to add it's location in your PATH environment variable.

Symbiosoft
  • 4,681
  • 6
  • 32
  • 46
  • Hi Esavard, Thx so much, it works , but I have to put the QtCore.dll and QtCored4.dll in the debug dir. Do u have any idea to fix that? Chris. – Chris Jan 31 '10 at 22:42
  • It's easy in fact, add the following to your PATH environment variable: %QTDIR%\bin All Qt DLL's are under the bin directory (for this to work, QTDIR environment variable must be defined correctly, ex: for Qt 4.5.2, I have QTDIR=C:\Qt\2009.02\qt). – Symbiosoft Feb 01 '10 at 00:02
  • Not a portable solution though. – CTZStef Jul 21 '13 at 18:41