Results 1 to 6 of 6

Thread: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

  1. #1
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2

    Question why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    I have a application based on qt 4.6.2(dynamically linking).
    and it uses a codec plugin named qcncodecs4.dll, which stands for Chinese.
    the plugin directory is set to the application folder using QApplication::setLibraryPaths(QStringList) in "main".
    I built it with VS 2008. The corresponding MSVCRT is MSVCR90.dll and MSVCP90.dll.
    It runs ok on windows xp sp3, which has MSVCRT90 in the C:\WINDOWS\WINSXS.
    BUT, When the app runs on windows xp sp1, which has NO msvcr90.dll and msvcp90.dll in the C:\WINDOWS\WINSXS, it cannot load the codec plugin correctly.

    the folder structure is as following :
    myapp/
    myapp/qtcore.dll
    myapp/myapp.exe
    myapp/codecs
    myapp/codecs/qcncodecs4.dll
    myapp/Microsoft.VC90.CRT/
    myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
    myapp/Microsoft.VC90.CRT/msvcm90.dll
    myapp/Microsoft.VC90.CRT/msvcp90.dll
    myapp/Microsoft.VC90.CRT/msvcr90.dll

    Finally, I tried to add A COPY OF "/Microsoft.VC90.CRT" to myapp/codecs, which looks as :
    myapp/
    myapp/qtcore.dll
    myapp/myapp.exe
    myapp/codecs
    myapp/codecs/Microsoft.VC90.CRT/
    myapp/codecs/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
    myapp/codecs/Microsoft.VC90.CRT/msvcm90.dll
    myapp/codecs/Microsoft.VC90.CRT/msvcp90.dll
    myapp/codecs/Microsoft.VC90.CRT/msvcr90.dll

    myapp/codecs/qcncodecs4.dll
    myapp/Microsoft.VC90.CRT/
    myapp/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
    myapp/Microsoft.VC90.CRT/msvcm90.dll
    myapp/Microsoft.VC90.CRT/msvcp90.dll
    myapp/Microsoft.VC90.CRT/msvcr90.dll

    This time , the application runs ok on windows xp sp1.
    And after I inspected the proccess using procexp.exe, I found that TWO INSTANCES of MSVCRT90 were loaded, ONE for qtcore.dll, ONE for codec/qcncodecs4.dll, while there was only ONE INSTANCE of qtcore.dll in the process.

    Why does the plugin use a different instance of msvcr90 from qtcore.dll, but the same instance of qtcore.dll as the caller?
    Last edited by qtofttt; 4th July 2010 at 16:24.

  2. #2
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2

    Default Re: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    Can some one help me , please?

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    I'm not a Microsoft compiler user but as I understand it you will get two instances of side-by-side DLLs because the system is maintaining isolation between the one loaded by the codec dll, and the one loaded by the application. It only does this for libraries that the application or library carries a manifest entry for.

    Why does it matter?

    If I were you I'd deploy the MSVC++ redist runtime (into system locations) with your application rather than use private copies.

  4. The following user says thank you to ChrisW67 for this useful post:

    qtofttt (5th July 2010)

  5. #4
    Join Date
    Aug 2009
    Posts
    52
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    Please read the manual: http://doc.qt.nokia.com/4.6/deployment-windows.html


    To solve the problem, you have to remove the manifest from the plugins (embedded as a resource) by adding the following line to the .pro file of the plugins you are compiling:

    CONFIG-=embed_manifest_dll

    You can refer:
    http://hi.baidu.com/cyclone/blog/ite...84bedbc57.html

  6. The following user says thank you to dbzhang800 for this useful post:

    qtofttt (5th July 2010)

  7. #5
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2

    Default Re: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    Quote Originally Posted by ChrisW67 View Post
    I'm not a Microsoft compiler user but as I understand it you will get two instances of side-by-side DLLs because the system is maintaining isolation between the one loaded by the codec dll, and the one loaded by the application. It only does this for libraries that the application or library carries a manifest entry for.

    Why does it matter?

    If I were you I'd deploy the MSVC++ redist runtime (into system locations) with your application rather than use private copies.
    It only does this for libraries that the application or library carries a manifest entry
    This DOES help me. Thanks.

  8. #6
    Join Date
    Jul 2010
    Posts
    4
    Thanks
    2

    Default Re: why does the plugin use a different instance of msvcr90.dll from qtcore.dll?

    Thanks for your reply. The problem was resolved according to your msg.

Similar Threads

  1. QtCore on an iPhone
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2010, 16:37
  2. Inside QtCore
    By falcon100 in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 12:42
  3. Replies: 0
    Last Post: 12th November 2009, 18:47
  4. Implementation for QtCore classes
    By suikodian in forum Newbie
    Replies: 5
    Last Post: 31st August 2009, 07:48
  5. Difference between QtCore4.lib and QtCore.lib
    By Barry79 in forum Installation and Deployment
    Replies: 0
    Last Post: 11th August 2009, 10:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.