Results 1 to 15 of 15

Thread: Deploying Qt apps compiled with Visual C++ Express Edition

  1. #1
    Join Date
    Dec 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Deploying Qt apps compiled with Visual C++ Express Edition

    Hello everyone,

    have have just found out that the Qt4 libs compiled with/for Visual C++ are way smaller than those for mingw.
    So I thought, it would be a good idea, to use Visual C++ with Qt on Windows (only for deploying the app, Qt Creator is just too good and I'm on Linux most of the time anyway).

    So my question is whether you do have to ship a certain runtime for apps compiled with Visual C++ or not?
    With mingw, you only need to ship the mingw and gcc dlls but apparently there is a thing called "Visual C++ Redistributable". Is it necessary that this is installed for the application to work?

    Thanks in advance

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Well, yes. You have to ship the Visual C++ run time library, which is included in the Visual C++ redistributable.

    On GCC, you have to ship the GCC runtime library, unless you statically link it.

    The advantage of Visual C++ is that its more common and thus more likely to already be installed on the PC. It's even shipped with the OS, but of course you can't confirm that its the correct version until its too late, so you normally distribute your program and Visual C runtime seperately unless it commercial, in which case, you bundle both together on the CD.

    Do note however, that there are incompatibilities between GCC and VC++. For example, compiler extensions (such as structure alignment and padding), different library files, etc, so it might not be as easy as doing your entire project under QtCreator and just recompiling under VC++ before deployment.

  3. #3
    Join Date
    Dec 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Mh, I think I'll stick with gcc in that case. As my programm is a downloadable application, it would be rather complicated to offer the Redistributable also or explain to the users why they have to install another programm.

  4. #4
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by fatjuicymole View Post
    Well, yes. You have to ship the Visual C++ run time library, which is included in the Visual C++ redistributable.

    On GCC, you have to ship the GCC runtime library, unless you statically link it.

    The advantage of Visual C++ is that its more common and thus more likely to already be installed on the PC. It's even shipped with the OS, but of course you can't confirm that its the correct version until its too late, so you normally distribute your program and Visual C runtime seperately unless it commercial, in which case, you bundle both together on the CD.

    Do note however, that there are incompatibilities between GCC and VC++. For example, compiler extensions (such as structure alignment and padding), different library files, etc, so it might not be as easy as doing your entire project under QtCreator and just recompiling under VC++ before deployment.
    Hi,
    Which is the Visual C++ run time library that I have to ship with the application?

    Best
    Franco Amato

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by wmnnd View Post
    Mh, I think I'll stick with gcc in that case. As my programm is a downloadable application, it would be rather complicated to offer the Redistributable also or explain to the users why they have to install another programm.
    Or you could use a installer program which automatically installs the appropriate files.

    Quote Originally Posted by franco.amato View Post
    Hi,
    Which is the Visual C++ run time library that I have to ship with the application?
    That depends on the version of VC++ used to compile your application and what libraries it depends on. For this reason, you should use the Redistributable Package for the version of the compiler you used. This ensures everything works and that you fully comply with any licensing.

  6. #6
    Join Date
    Dec 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    But why would I want to use MSVC++ if it's so much more complicated to deploy my apps then?
    Does it have any benefits (except for binaries which are a little smaller)?

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by wmnnd View Post
    But why would I want to use MSVC++ if it's so much more complicated to deploy my apps then?
    Does it have any benefits (except for binaries which are a little smaller)?
    It's not more complicated if you write the entire app using it. It CAN get more complicated if you write your app in QtCreator and then port it across to MSVC++ for the final deployment, which is what you said in your first post.

    If you don't want the hassles of using two different compilers, then stick with the one you prefer. I know I wouldn't want to do the entire app using QtCreator, then all the testing, and then port and re-test under MSVC++. I'd use one and stick with it.

  8. #8
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by fatjuicymole View Post
    Or you could use a installer program which automatically installs the appropriate files.

    That depends on the version of VC++ used to compile your application and what libraries it depends on. For this reason, you should use the Redistributable Package for the version of the compiler you used. This ensures everything works and that you fully comply with any licensing.
    Hi,
    how can I use that package? I never used it.

    Thanx in advance.

    Best Regards
    Franco Amato

  9. #9
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    What package ?

  10. #10
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by wmnnd View Post
    But why would I want to use MSVC++ if it's so much more complicated to deploy my apps then?
    Does it have any benefits (except for binaries which are a little smaller)?
    I think it is not more compilcated - you just have to ship different dlls than with MinGW. (something like mscrt90.dll or something)
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  11. #11
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    But why would I want to use MSVC++ if it's so much more complicated to deploy my apps then?
    Does it have any benefits (except for binaries which are a little smaller)?
    Check this post and this link.
    It seems that not only the size but better performance. Personally I use QtCreator, I prefer it better, and not being a professional, I prefer KISS (keep it simple stupid) and save myself the pain of installing MSCV and putting it to work. Besides I dont like the ideia of having to install the MS Redistributable Package

    Hi,
    how can I use that package? I never used it.
    Just download it from Microsoft site and install it.
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  12. #12
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    I'm using QtCreator under Windows7 but without MinGW, so it uses Visual Studio toolchain, which I have installed on my system.
    If you have Visual Studio installed then there is in path like this:
    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\redist\x86
    are dirs with required dlls. CRT are base dlls (C RunTime).
    Also you can have look here which is a sub page of this page.
    Also you can use Dependency Walker to determine which of those dlls are used by your app.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  13. #13
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    Quote Originally Posted by fatjuicymole View Post
    What package ?
    The Redistributable package
    Franco Amato

  14. #14
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    It's just download and run, literally. For Visual Studio 2008, you would download http://www.microsoft.com/downloads/d...d-074b9f2bc1bf whereas for VS2005, you would download http://www.microsoft.com/downloads/d...9-220b62a191ee, or just include the appropriate file with your download or cd and it'll install whatever is necessary.

  15. #15
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Deploying Qt apps compiled with Visual C++ Express Edition

    I noticed use of Visual Studio and Qt Creator are seen as either/or. It's not that way. Though Nokia/Qt recommends the Visual Studio add-ins approach, one can also just use the MSVC compiler and develop with Qt Creator. I do that. All works, debugging etc. Nice!
    www.bmdesign.fi
    we want to move you

Similar Threads

  1. Qt and Visual Studio Express Edition 2008
    By PUK_999 in forum Installation and Deployment
    Replies: 1
    Last Post: 20th August 2009, 13:36
  2. Replies: 1
    Last Post: 8th February 2009, 15:08
  3. Qt 4.4.1 Compile Error with MS Visual C++ 2008 Express SP1
    By BrainB0ne in forum Installation and Deployment
    Replies: 3
    Last Post: 19th August 2008, 15:49
  4. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  5. Qt 4 commercial with Visual C++ 2005 Express Edition: Works half, debug fails
    By axeljaeger in forum Installation and Deployment
    Replies: 4
    Last Post: 5th July 2006, 05:38

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.