Results 1 to 2 of 2

Thread: I'm having a hard time wrapping my head around Projects.

  1. #1

    Default I'm having a hard time wrapping my head around Projects.

    Can someone please translate how to do this for me? My goal is "to build a standalone app from a group of semi-independent modules."

    I'll compare with Visual Studio .NET because that's what I've been using at work for the last few years, so that process is fresh in my mind.

    In .NET, I can build assemblies into DLLs, and when you build an app that depends on your other assemblies, all the necessary DLLs get copied into the output along with the produced EXE.

    What is the way to do this in Qt (or perhaps more accurately, using qmake)?

    Let's say I have a structure that looks like this:

    /dev/strutils/*.cpp, *.h - a utility library for string parsing.
    /dev/intutils/*.cpp, *.h - a utility library for printing formatted numbers.

    /dev/myapp/data/*.cpp, *.h - all the database access classes for MyApp.
    /dev/myapp/widgets/*.cpp, *.h, *.ui - all the custom widgets I wrote for MyApp.

    /dev/myapp/myapp.pro, *.cpp, *.h, *.ui - a gui app that I want to distribute.

    In VS.NET, I would have assemblies for strutils, intutils, and myapp. If data and widgets were very large, I might make them separate assemblies too. Everything but myapp would be a DLL project, myapp would be an EXE project. When I built myapp, strutils.dll, intutils.dll, etc would all wind up in my /build/release dir and I could bundle all those binaries together and distribute them.

    It seems like (and please correct me if I'm not thinking of things the "qmake" way) I should have .PRO files for strutils, intutils, and possibly data and widgets if they were large. But after that I'm kind of stumped... how do I make myapp.pro "reference" the output from the other projects in a way that says "I need to include that output along with my own"?

    P.S. I guess I should say, my question is slightly different for dynamic vs. static linking. If we're talking static linking, I just need to know how to make the reference at all, because with static linking the output of myapp would be a single file containing everything from all dependencies. Dynamic linking is when I'd actually need the output from the other libraries. Correct? I also need to do some research on static vs. dynamic linking, of late I've always done dynamic (I.E. DLLs) without really knowing the rationale for choosing one over the other.
    Last edited by jeffadams78; 15th March 2009 at 18:55. Reason: updated contents

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: I'm having a hard time wrapping my head around Projects.

    Quote Originally Posted by jeffadams78 View Post
    What is the way to do this in Qt (or perhaps more accurately, using qmake)?
    It's the same. The "assemblies" are called libraries (hence the name DLL with the last "L" meaning "library"), by the way.

    It seems like (and please correct me if I'm not thinking of things the "qmake" way) I should have .PRO files for strutils, intutils, and possibly data and widgets if they were large.
    Yes, that's correct.

    But after that I'm kind of stumped... how do I make myapp.pro "reference" the output from the other projects in a way that says "I need to include that output along with my own"?
    You use the LIBS qmake variable. Possibly some other as well.

    P.S. I guess I should say, my question is slightly different for dynamic vs. static linking. If we're talking static linking, I just need to know how to make the reference at all, because with static linking the output of myapp would be a single file containing everything from all dependencies. Dynamic linking is when I'd actually need the output from the other libraries. Correct?
    Static and dynamic linking are practically the same. The only difference is that with static linking you get one file to deploy at the cost of bigger memory footprint and with dynamic linking you may have to deploy more than one file. There are of course other differences and reasons for using one over another but that's a different issue.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Tags for this Thread

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.