Results 1 to 3 of 3

Thread: QJson Windows compile problem

  1. #1
    Join Date
    Jan 2010
    Posts
    40
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QJson Windows compile problem

    I have developed a Qt application in Linux that uses the QJson library. It works fine, and now I am trying to port it to Windows. I got the source from the git repository, extracted it to C:\Qjson, and built it using Qt Creator. I now have a qjson0.dll file in my C:\Qjson\lib directory. I can't seem to link to it though. I downloaded the sample foo application and changed the include path and libs lines to:
    INCLUDEPATH += C:\Qjson\src
    LIBS += Lc:\Qjson\lib -lqjson0

    But every time I try to build, I get "qjson/parser.h:no such file or directory". The paths to the header files and dll are correct. BTW, I also tried :
    LIBS += C:\Qjson\lib\qjson0.dll

    as well. No difference. Any insights?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QJson Windows compile problem

    Quote Originally Posted by skepticalgeek View Post
    I have developed a Qt application in Linux that uses the QJson library. It works fine, and now I am trying to port it to Windows. I got the source from the git repository, extracted it to C:\Qjson, and built it using Qt Creator. I now have a qjson0.dll file in my C:\Qjson\lib directory. I can't seem to link to it though. I downloaded the sample foo application and changed the include path and libs lines to:
    INCLUDEPATH += C:\Qjson\src
    LIBS += Lc:\Qjson\lib -lqjson0
    No, that's not correct.

    1. do not use absolute paths if you intend to release your code.
    Instead you yourself and your users should install Qjson in known paths. Check the Qt documentatioon.

    2. your LIBS variable is wrong, it should be:
    Qt Code:
    1. LIBS += -Lc:\Qjson\lib -lqjson0
    To copy to clipboard, switch view to plain text mode 

    But every time I try to build, I get "qjson/parser.h:no such file or directory". The paths to the header files and dll are correct.
    The paths are not correct, obviously.
    The error also says everything you need to know.

    does c:\Qjson\src\qjson\parser.h exist?
    If not, and I'm sure it doesn't, find the correct folder where it is located and use that folder as include path.

    By the way, if you do install Qjson in known paths, you do not have this problem!

    BTW, I also tried :
    LIBS += C:\Qjson\lib\qjson0.dll

    as well. No difference. Any insights?
    That's certainly not correct!

  3. #3
    Join Date
    Jan 2010
    Posts
    40
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QJson Windows compile problem

    Thanks. Solved my issue.

Similar Threads

  1. Can't get Qt SDK to compile (Windows)
    By mrlucmorin in forum Installation and Deployment
    Replies: 3
    Last Post: 30th June 2010, 16:36
  2. Compile and deploy to Windows CE
    By Luc4 in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 16th February 2010, 03:42
  3. How to add a plugin? (QJson)
    By Thomas Wrobel in forum Newbie
    Replies: 5
    Last Post: 3rd December 2009, 22:46
  4. Problem compile example in windows
    By walito in forum Newbie
    Replies: 3
    Last Post: 10th December 2008, 22:41
  5. I can't compile my program in windows!!
    By brevleq in forum Qt Programming
    Replies: 12
    Last Post: 29th November 2007, 23:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.