views:

749

answers:

1

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.

+2  A: 

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.

esavard
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
It's easy in fact, add the following to your PATH environment variable:%QTDIR%\binAll 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).
esavard