Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
6.7.2
-
None
Description
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.
Attachments
Issue Links
- duplicates
-
QTBUG-125975 QT_DISABLE_DEPRECATED_UP_TO 0x060400 gives link error with static build
- Closed
- is duplicated by
-
QTBUG-127456 QObject::setProperty broken in static builds
- Closed
- relates to
-
QTBUG-109449 inlining QByteArray::isNull() causes BC break on static Qt builds
- Closed