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

QT_DISABLE_DEPRECATED_UP_TO breaks ABI with static builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.7.2
    • None
    • Windows

      When I do Qt FW static build (using vcpkg) and link my library statically against this Qt using eg. QT_DISABLE_DEPRECATED_UP_TO=0x060900 (defined for my library and exe) then the build fails with: 

      Qt6Cored.lib(removed_api.cpp.obj) : error LNK2005: "public: bool __cdecl QByteArray::isNull(void)const " (?isNull@QByteArray@@QEBA_NXZ) already defined in TinyOrm0d.lib(querybuilder.cpp.obj) 
      Qt6Cored.lib(removed_api.cpp.obj) : error LNK2005: "public: __int64 __cdecl QString::toLongLong(bool *,int)const " (?toLongLong@QString@@QEBA_JPEA_NH@Z) already defined in TinyOrm0d.lib(completecommand.cpp.obj) 
         Creating library examples\tom\tom.lib and object examples\tom\tom.exp 
      examples\tom\tom.exe : fatal error LNK1169: one or more multiply defined symbols found

      This is how exe/lib are linked:
       

      tom.exe
      └── tinyorm.lib
          └── QtCored.lib
      

      The QT_DISABLE_DEPRECATED_UP_TO=0x040800 is defined by default for Qt FW and for removed_api.cpp.

      If I remove the QT_DISABLE_DEPRECATED_UP_TO for my library and exe and leave it at the default then it compiles.

      So it fails if QT_DISABLE_DEPRECATED_UP_TO=0x040800 for Qt FW and QT_DISABLE_DEPRECATED_UP_TO=0x060900 for my library/exe.

      Shared builds work well.

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

            qtbuildsystem Qt Build System Team
            silverq Silver Zachara
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes