Results 1 to 7 of 7

Thread: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Hello!

    I'm having some trouble trying to run my new app outside QtCreator in all tested computers besides my home's one, where everything works fine.

    To be more precise, each time I try to run the .exe outside Qt Creator using Qt 5.1.0 compiled dinamically with MinGW in a folder where all the necessary dlls are included - as far as I know, that is, as far as Windows and my experience with Qt tells me) the same "Microsoft Visual C++ Runtime Error" appears.
    In one of such computers I even have Qt and everything else installed and even trying to run a basic mainwindow software doesn't work - so I know that this is not a consequence of my new app having more complexity; no software done in Qt is working in this machine. I also installed some other software previously done in Qt that worked quite well and they don't work here for the same reason.

    Trying to solve this problem, I installed the Microsoft Visual C++ Runtime lib on the mentioned computer, without success. Doing some research I found the thread http://www.qtcentre.org/threads/5322...-Library-error , where Chris suggest that mingwm10.dll is lacking. Indeed, I don't have this file on the folder but Windows don't warn me about that and neither I could find it in the Qt installation folder.


    So why is any Qt based app being prevented to run outside Qt creator in this PC I'm trying to? Remembering that at home, everything runs fine, and this PC does have Qt installed.


    I'm glad for any help,

    Momergil

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Do you have the file "qwindows.dll" installed in a "plugins/platforms/" subdirectory of the directory where your other DLLs and EXE are located?

    Are you mixing Visual C++ and MinGW DLLs? Everything has to be from the same compiler - EXE and all DLLs - you can't mix and match.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Quote Originally Posted by d_stranz View Post
    Do you have the file "qwindows.dll" installed in a "plugins/platforms/" subdirectory of the directory where your other DLLs and EXE are located?

    Are you mixing Visual C++ and MinGW DLLs? Everything has to be from the same compiler - EXE and all DLLs - you can't mix and match.

    Thanks d_stranz for the reply.

    No, I don't have such file and never needed it in any Qt installation - and in my PC I don't have such file in the mentioned subfolder and it works well. The only place I found it was in Qt Creator's bin directories. Should I try with a copy of that one?

    I'm sure I'm not mixing Visual C++ and MinGW dlls - I don't have Visual C++/visual Studio/MSVC neither in my computer at home, nor in the other, mentioned computer; all Qt installations where allways performed using MinGW as choosed compiler.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    You *do* need it. This is a change from Qt 4.x. The reason you don't need it on your development PC is because QtCreator knows where to look for it (in your Qt install directory) and automatically loads it at run time. They made the change in Qt 5.0 because now the core library has no dependencies on the platform - all that has been moved to the platform DLL.

    So, in addition to the normal Qt and other DLLs you need in the executable directory, you need to also install the qwindows.dll. I was slightly wrong in my last post; it needs to live in ./platforms/qwindows.dll relative to the exe directory. See this article.

  5. The following user says thank you to d_stranz for this useful post:

    Momergil (26th November 2013)

  6. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Quote Originally Posted by d_stranz View Post
    You *do* need it. This is a change from Qt 4.x. The reason you don't need it on your development PC is because QtCreator knows where to look for it (in your Qt install directory) and automatically loads it at run time. They made the change in Qt 5.0 because now the core library has no dependencies on the platform - all that has been moved to the platform DLL.
    d_stranz, thanks very much for the explanation; I was totally unaware of this information. I'll try that solution as soon as possible and return with the feedback.

  7. #6
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Yes, it did actually work; that was the problem.

    Thanks d_stranz once again!

    Momergil

  8. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Microsoft Visual C++ Runtime Library problem while running app outside QtCreator

    Sure. It took me a lot of head-banging and hair-pulling before I figured it out.

    It is sort of disappointing that since the move from Nokia to Digia / qt-project.org so much of the documentation seems to have been turned over to user-contributed articles which aren't being kept up to date or indexed for the current release. Most of the time when you use the drop-down link to select the version of Qt you're working with, you end up on the main documentation home page for that version, and no way to search effectively. For example, the link I gave you was for Qt 5.0. It you chage the version to the current Qt 5.1 release, it drops you onto the 5.1 documentation home page.

Similar Threads

  1. Replies: 2
    Last Post: 30th July 2013, 10:05
  2. Replies: 9
    Last Post: 10th February 2013, 22:42
  3. Replies: 4
    Last Post: 30th September 2012, 11:18
  4. Microsoft Visual C++- Runtime Library Error while deploying Qt Application
    By mammaiap in forum Installation and Deployment
    Replies: 1
    Last Post: 7th May 2011, 01:41
  5. Replies: 1
    Last Post: 20th September 2010, 17:49

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.