Qt msvc2015 32 bit binaries with msvc 2017 32 bit compiler

  • 8 months ago
Comment

ChatGPT
1 / 1

Mixing different versions of Visual Studio and Qt can lead to compatibility and linking issues. However, if you still want to use Qt 32-bit binaries built with MSVC2015 with a project compiled with MSVC2017, you can try the following steps:

  1. Install Qt with MSVC2015: Download the 32-bit Qt libraries built with MSVC2015. Make sure you choose the appropriate version (32-bit) and MSVC2015 as the compiler during installation.

  2. Configure Qt in your project: Open your Qt project in Qt Creator. Go to "Projects" on the left sidebar, select your build configuration, and choose the Qt version that you installed with MSVC2015.

  3. Configure the MSVC compiler: Since you are using MSVC2017, configure the project to use the MSVC2017 compiler in the "Projects" settings.

  4. Linking to Qt: In your project's .pro file, you need to add the paths to the Qt headers and libraries for MSVC2015. Use the following syntax:

    qmake
    win32:CONFIG(release, debug|release): LIBS += -L<path_to_msvc2015_qt_libs> -lQt5Core -lQt5Gui -lQt5Widgets

    Replace <path_to_msvc2015_qt_libs> with the actual path to the MSVC2015 Qt libraries.

  5. Build the project: Build your project using the MSVC2017 compiler. It should be able to link against the MSVC2015 Qt libraries.

However, be aware that mixing different versions of Visual Studio and Qt can lead to runtime issues, especially if the MSVC2015 and MSVC2017 runtime libraries are not compatible. It's recommended to stick with the same version of the compiler for your project and the libraries you use.

If possible, it's better to update the Qt libraries to match the compiler version you are using. This will help you avoid potential compatibility issues and ensure that you're working with a consistent development environment.