PDA

View Full Version : Linking files from different projects



kzaarouri
4th March 2012, 01:08
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).

ChrisW67
4th March 2012, 03:02
You need to use the INCLUDEPATH and LIBS variables as described in the QMake manual

kzaarouri
4th March 2012, 03:26
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.

ChrisW67
4th March 2012, 04:54
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"?