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. [SOLVED] QT 4.8* VS2010 /MT & /MTd
Qt 6.11 is out! See what's new in the release blog

[SOLVED] QT 4.8* VS2010 /MT & /MTd

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 3 Posters 9.0k Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi everyone!
    My should be destributed with InnoSetup installation for normal users(without any admin rights), and Qt needs vcredist to be installed wich needs admin rights to be installed... so I've decided to compile Qt(and my App itself) with /MT flag instead of /MD...
    I've simply changed qmake.conf in mkspecs/win32-msvc2010:
    @QMAKE_CFLAGS_RELEASE = -O2 -MT
    QMAKE_CFLAGS_DEBUG = -Zi -MTd
    @

    Compilation was done flawlessly... without any errors....

    BUT, using QtWebKit brings me following error:
    @Invalid Address specified to RtlFreeHeap@

    Is that a known BUG? Is it WebKit or Qt BUG?
    And is it possible to get rid of it?

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

      Hi,

      if I remember correctly, "/MT links the c-runtime statically.":http://msdn.microsoft.com/en-us/library/2kzt1wy3(v=vs.80).aspx This means, each library and the executable have own versions of the c-runtime.

      Statical linkage might result in different heaps you are using which will exactly throw out this error.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Oh, right! I've totally forget about that!!! Allocating heap in one dll with own crt and trying to free it in another with it own crt can't be done! Thank you!

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hello All,
          I am new QT and I have been trying to build a static build of QT for MSVC2013. But the Nmake fails with the following types of linker errors. Appreciate your help in resolving these :
          link /NOLOGO /DYNAMICBASE /NXCOMPAT /STACK:4194304 /INCREMENTAL:NO /SUBSYSTEM:CONSOLE/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' proces
          sorArchitecture='
          '" /MANIFEST/MANIFESTFILE:......\bin\qdoc.exe.embed.manifes
          t /OUT:......\bin\qdoc.exe @C:\Users\dlink14\AppData\Local\Temp\nm1DD8.tmp
          Qt5Xml.lib(qdom.obj) :

          error LNK2038: mismatch detected for 'RuntimeLibrary': va
          lue 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in atom.obj
          Qt5Xml.lib(qxml.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in atom.obj
          msvcprt.lib(MSVCP120.dll) : error LNK2005: "void __cdecl std::_Xbad_alloc(void)"
          (?_Xbad_alloc@std@@YAXXZ) already defined in libcpmt.lib(xthrow.obj)
          msvcprt.lib(MSVCP120.dll) : error LNK2005: "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
          msvcprt.lib(MSVCP120.dll) : error LNK2005: "void __cdecl std::_Xout_of_range(char const *)" (?_Xout_of_range@std@@YAXPBD@Z) already defined in libcpmt.lib(xthrow.obj)
          msvcprt.lib(MSVCP120.dll) : error LNK2005: "char const * __cdecl std::_Syserror_map(int)" (?_Syserror_map@std@@YAPBDH@Z) already defined in libcpmt.lib(syserror
          .obj)
          msvcprt.lib(MSVCP120.dll) : error LNK2005: "char const * __cdecl std::Winerror
          map(int)" (?_Winerror_map@std@@YAPBDH@Z) already defined in libcpmt.lib(syserror.obj)
          MSVCRT.lib(MSVCR120.dll) : error LNK2005: _memmove already defined in LIBCMT.lib(memmove.obj)
          MSVCRT.lib(MSVCR120.dll) : error LNK2005: __hypot already defined in LIBCMT.lib(hypot.obj)
          MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_in fo(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBC
          MT.lib(typinfo.obj) MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscalltype_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) a
          lready defined in LIBCMT.lib(typinfo.obj)
          Creating library ......\bin\qdoc.lib and object ......\bin\qdoc.exp
          LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
          ......\bin\qdoc.exe : fatal error LNK1169: one or more multiply defined symbols found NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x491'
          Stop.
          NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'

          I have configured the conf file as advised in the post as follows
          QMAKE_CFLAGS_RELEASE = -O2 -MT
          QMAKE_CFLAGS_DEBUG = -Zi -MTd

          and before running nmake set the configuration as follows :
          configure -debug-and-release -opensource -static -opengl desktop -mp -nomake examples -platform win32-msvc2013

          • Appreciate your response.

          thanks.

          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