Can't build Qt5 (qtbase) on Windows XP (win32-msvc2005)

Can't build Qt5 (qtbase) on Windows XP (win32-msvc2005)

  • dfaure 7 years ago

    In a cmd.exe prompt, using msysgit, I cloned git://gitorious.org/qt/qtbase.git.
    Set QTDIR to that qtbase directory, added %QTDIR%\bin to PATH.
    Made sure sh.exe is not in the PATH. Set
    The problem:

    configure -developer-build -opensource -nomake examples -nomake tests
    fails with a link error for configure.exe, due to duplicated symbols:
    @
    Please wait while bootstrapping configure ...

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.

        link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /SUBSYSTEM:CONSOLE " /MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST /MANIFESTFILE:"configure.intermediate.manifest" /OUT:..\..\configure.exe @C:\DOCUME~1\kdabian\LOCALS~1\Temp\nm46.tmp
    

    environment.obj : error LNK2005: "public: __thiscall public: __thiscall QList<class QString>::QList<class QString>(class QList<class QString> const &)'::5'::Cleanup::Cleanup(struct QListData::Data *)" (??0Cleanup@?4???0?$QList@VQString@@@@QAE@ABV1@@Z@QAE@PAUData@QListData@@@Z) already defined in configureapp.obj
    environment.obj : error LNK2005: "public: __thiscall public: __thiscall QList<class QString>::QList<class QString>(class QList<class QString> const &)'::5'::Cleanup::~Cleanup(void)" (??1Cleanup@?4???0?$QList@VQString@@@@QAE@ABV1@@Z@QAE@XZ) already defined in configureapp.obj
    @
    and a lot more of the same.

    Sample compilation line, to see the flags:
    @
    cl -c -FIconfigure_pch.h -Yuconfigure_pch.h -Fpconfigure_pch.pch -MP -nologo -Zm200 -Zc:wchar_t -MT -W3 -GR -EHsc -w34100 -w34189 -DUNICODE -DQT_NO_CODECS -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -D_CRT_SECURE_NO_DEPRECATE -DQT_BOOTSTRAPPED -DCOMMERCIAL_VERSION -I"....\include" -I"....\include\QtCore" -I"....\include\QtCore\5.0.0" -I"....\include\QtCore\5.0.0\QtCore" -I"C:\Qt\qtbase\tools\shared" -I"C:\Qt\qtbase\mkspecs\win32-msvc2008" C:\Qt\qtbase\src\corelib\xml\qxmlstream.cpp C:\Qt\qtbase\src\corelib\xml\qxmlutils.cpp qxmlstream.cpp
    @
    (funny that -opensource sets -DCOMMERCIAL_VERSION, but that's unrelated...)
    Strange, too that my QMAKESPEC being set to win32-msvc2005 leads to win32-msvc2008 in the compilation line.

    David Faure (david.faure@kdab.com)
    KDE/Qt Senior Software Engineer
    KDAB - Qt Experts - Platform-independent software solutions

    0

    3
    Posts

    5.4k
    Views

    Log in to reply

     


  • gonzoua 7 years ago

    I had this problem too. It looks like there is no way around it except upgrading Visual Stduio. The problem is described here: http://stackoverflow.com/questions/2078087/local-classes-inside-inline-non-member-function-produces-lnk2005-with-msvc2005

    The code that triggers the problem is in qlist.h:

    @template <typename T>
    Q_OUTOFLINE_TEMPLATE QList<T>::QList(const QList<T> &l)
    : d(l.d)
    {
    if (!d->ref.ref()) {
    p.detach(d->alloc);

        struct Cleanup
        {
            Cleanup(QListData::Data *d) : d_(d) {}
            ~Cleanup() { if (d_) free(d_); }
    
            QListData::Data *d_;
        } tryCatch(d);
    
        node_copy(reinterpret_cast<Node *>(p.begin()),
                reinterpret_cast<Node *>(p.end()),
                reinterpret_cast<Node *>(l.p.begin()));
        tryCatch.d_ = 0;
    }
    

    }
    @

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lst0426

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值