Results 1 to 4 of 4

Thread: Linking files from different projects

  1. #1
    Join Date
    Mar 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Linking files from different projects

    Hi there,

    In my application I have 2 project (DLL_test and Main).
    DLL_test generates a dll file and Main uses the dll file.
    For Main to be able to use the dll file I need to add the header files of DLL_test inside Main project.
    But now assume that I change the header of DLL_test then I have to go back and copy it to Main project.

    Is there a way to link them together under QTcreator (windows)? So that when I change the file in DLL_test it automatically update the version in MAIN?
    I think in linux I can just use static/hard binding (but im no linux expert).

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Linking files from different projects

    You need to use the INCLUDEPATH and LIBS variables as described in the QMake manual

  3. #3
    Join Date
    Mar 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Linking files from different projects

    Yes you are absolutely correct, and that is what I did for a while, but then I realised that I need those header in my main project so that when I decide to take the entire project it will still compile without having foreign includes.
    I don't know I thought there would be a nice way to do so..

    Thanks.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Linking files from different projects

    You can't have it both ways, either you ship the entire source of your program and it builds, or you omit parts unique to your project and the program doesn't compile. Qt has no control over how you package your source code. I am not sure what sort of magic you are expecting Qt to do for you to make it "nicer"?

Similar Threads

  1. Replies: 4
    Last Post: 20th March 2011, 18:18
  2. Replies: 2
    Last Post: 7th September 2010, 21:19
  3. Compiling QT programs in Visual C++ 2008 by including batch files, reloaded projects
    By Meek the Geek in forum Installation and Deployment
    Replies: 6
    Last Post: 12th July 2010, 20:11
  4. linking the files with openGL code
    By Abeer in forum Newbie
    Replies: 1
    Last Post: 25th May 2010, 01:10
  5. Replies: 7
    Last Post: 11th December 2009, 05:01

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.