Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-131575

Qt automatically opts into MSVC's <experimental/coroutine> ABI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.6.0
    • Core: Other
    • None
    • Windows

    Description

      I'm getting link errors about _COROUTINE_ABI missmatch:

      LNK2038    mismatch detected for '_COROUTINE_ABI': value '1' doesn't match value '2' in ....obj    ...\Qt6Cored.lib(qlocale_win.cpp.obj)

      This error only happens when i'm on a static build, ** and only on debug mode, release compiles fine.

      You also need to be using C+20, lower versions this error is supressed see:

      https://devblogs.microsoft.com/oldnewthing/20230111-00/?p=107694

      Otherwise, you’ll have to downgrade your program to use pre-standardization coroutines. One way is to downgrade the entire program to C++17 with /await. But you may not want to throw away that much baby with the bathwater, since you’ll lose all the C++20 features. You can also use the /await switch in combination with /std:c++20 or /std:c++latest to say “I want pre-standardization coroutines” with as much of the newer language features as possible, provided they don’t create compatibility issues.

       

      It can be reproduced by including any of these includes:

      #include <winrt/Windows.System.Profile.h>
      #include <winrt/Windows.Security.Cryptography.h>

       

      A simple static console application on MSVC (static/debug/C++20) throw this link error:

      #include <QtCore/QCoreApplication>
      #include <winrt/Windows.System.Profile.h>
      #include <winrt/Windows.Security.Cryptography.h>
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
          return a.exec();
      }
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            geraldo Geraldo Tristao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes