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



  • 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?



  • 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.



  • 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!



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.