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

QT QString = operator nonconsistent in VS 2005 and VS 2010

    XMLWordPrintable

Details

    Description

      It's a bit longer story, so I'll start with some background and then move on to the issue.

      We're developing a Qt-based solution, which is developed at two locations - main exe which is developed on a VS 2005 (on a locally build QT 4.8.5, built from sources on the download page), and a dll, used by this exe, which is being developed in VS 2010 environment (QT 4.8.5 dll/lib files were taken prebuilt from the downloads page). Until very recently all was well, but the last build of the dll started producing problems (dll not being loaded by exe), as not all dependencies for the dll were satisfied.

      In the end, I pinned it down to my build of QTCore4.dll missing two exported functions, namely (mangled names, as my 'undname' can't unmangle these):
      ??4QString@@QAEAAV0@$$QAV0@@Z
      ??4QVariant@@QAEAAV0@$$QAV0@@Z

      So I investigated further and found out that ??4 at start means the '= operator', thus I'm missing one version of = operator for Qstring and one for QVariant. So I zoomed in on QString and checked the prebuilt VS2010 dll - where I found 8 '= operators' exported from QTCore4.dll, while mine had 6. Then I checked the documentation of QString and found 6 different '=' operators, meaning that the prebuilt VS2010 dll has two additional '=' operators which are not even documented. While I was unable to unmangle the operator that produces trouble, the other 'extra' = is a

      public: class QString & __thiscall QString::operator=(struct QString::Null
      const &)

      The problem can be easilly reproduced by bulding QT 4.8.5 from sources with Visual Studio 2005 with:

      configure -debug-and-release -opensource -shared -exceptions -no-scripttools -vcproj -qt-sql-mysql -qt-sql-odbc -plugin-sql-mysql -plugin-sql-odbc -no-qt3support -platform win32-msvc2005 -phonon -phonon-backend -multimedia -nomake demos -nomake examples

      And check the QTCore4.dll exports starting with ??4QString and compare them with prebuilt QTCore4.dll exports on website. In my opinion the prebuilt ones are actually problematic, as they have two extra operators, which are not specified as part of QT 4.8.5

      Greets, Toni

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            buldozer Toni Rutar Lokar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes