Results 1 to 4 of 4

Thread: Cannot mix incompatible Qt library

  1. #1
    Join Date
    May 2018
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Cannot mix incompatible Qt library

    I created a new Qt-Widget project, built it, put the windows.dll where it belonged, and tried to run it. I got the error:

    Cannot mix incompatible Qt library (version 0x50402) with this library (version 0x50401)

    I have only Qt 5.4.2 installed. I did not make any change to the project in the very simple form in which QtCreator created it.

    My Qt Creator is:
    Qt Creator 3.4.1 (opensource)
    Based on Qt 5.4.2 (MSVC 2013, 32 bit)
    Built on May 28 2015 19:07:19
    From revision 29d81424a2

    In the same directory as this project, I have another project created and built with the same Creator, and it works fine.

    What could be the difference?

  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: Cannot mix incompatible Qt library

    put the windows.dll where it belonged
    You must use the Qt DLLs that come from your Qt install bin directory, not the Qt Creator installation directory. If you are copying files from Qt Creator's install directory these could be different from those in your Qt distribution. Qt Creator is standalone and uses its own set of DLLs, which could be different from your Qt distribution.

    Also check to see that your PATH variable is pointing to the right place - your Qt install bin directory and not somewhere else.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    May 2018
    Posts
    13
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Cannot mix incompatible Qt library

    Qt Creator is coming from within the QT5.4.2 directory hierarchy. I tried adding its bin to the PATH, but no help. I don't think I can completely remove 5.4.2 from the path or other things will break. If it's all installed together, why would there be this problem?

    Is there some way to get Creator to tell me what library is in question and where it's actually getting the versions, rather than just saying that 5.4.1 and 5.4.2 are not compatible?

    I ran Creator and created a brand-new project in exactly the same location with copies of exactly the same Windows dll as another project that works perfectly. The new project gets the incompatible-libraries error, even though they are in the same place and created with the same Creator.

  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: Cannot mix incompatible Qt library

    Did you recently install another piece of software (unrelated to your Qt install) that might have inserted its path into your PATH environment variable? Check to make sure that new app didn't install its own set of Qt DLLs that are being found before yours are.

    I don't use Qt Creator enough to know, but when you run a program in the debugger using Visual Studio, it lists the full path to every DLL it loads or unloads. That's how I discovered a similar problem - there was an older version of Qt that was being found before the one I built against, and that was causing runtime errors. I would be surprised if Qt Creator didn't have some traceback like this as well.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Qt Creator Qt5.8 - incompatible library problem
    By TonyB in forum Qt Tools
    Replies: 3
    Last Post: 25th April 2017, 18:32
  2. Replies: 0
    Last Post: 21st November 2012, 18:11
  3. Replies: 6
    Last Post: 31st July 2012, 20:35
  4. Cannot mix incompatible Qt library
    By ycyclop in forum Installation and Deployment
    Replies: 0
    Last Post: 12th March 2012, 13:01
  5. Cannot mix incompatible Qt library
    By hubipet in forum Qt Programming
    Replies: 4
    Last Post: 13th February 2012, 19:03

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.