Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't build Qt5 (qtbase) on Windows XP (win32-msvc2005)
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 3 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dfaure
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • G Offline
      G Offline
      gonzoua
      wrote on last edited by
      #2

      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;
      }
      

      }
      @

      1 Reply Last reply
      0
      • RochusR Offline
        RochusR Offline
        Rochus
        wrote on last edited by
        #3

        You can use the /FORCE linker option to get rid of the linker errors (the linker reports warnings instead). Here's a description on how to succeed with the complete build of Qt5 qtbase on XP using msvc2005 (so you don't have to upgrade): http://qt-project.org/forums/viewthread/27666/

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved