Results 1 to 6 of 6

Thread: Application seems not to be linked statically

  1. #1
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Application seems not to be linked statically

    Hi,
    my little application does not seem to be "completely" statically linked, although I configured it to be linked statically (the *.pro file is attached).

    I am using Qt-4.3.4 (opensource) under Windows XP, with MS Visual Studio 2005 Pro Edition (SP1 is installed).
    I used qmake to generate project files for Visual Studio, which worked fine. I can compile and debug in VS, or alternatively in the console with nmake.

    When taking the executable to another PC (no VS and no Qt installed) I get the error message (I apologize for the german language, but the message is displayed in german ): "Diese Anwendung konnte nicht gestartet werden, weil die Andwendungskonfiguration nicht korrekt ist. Zur Problembehandlung sollten Sie die Anwendung neu installieren."

    When using the Dependency Walker (http://www.dependencywalker.com/ A fine tool, by the way), it tells me the app is missing the following dll files: msvcp80d.dll and msvcr80d.dll. So I copied the files to the same directory as the exe.
    But there is somthing wrong with a third dll: mpr.dll. It is not missing, but an exported function does not seem to be in the dll.

    Anyway, I always though, that linking statically makes the exe independent of installed dlls (yes, I read the Wiki articles about building static Qt and building static apps).
    What is wrong with my application or build process?
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Application seems not to be linked statically

    Hi, please follow the instructions in our wiki: [WIKI]Building static applications[/WIKI]

    Notice also this: Why does a statically built Qt use the dynamic Visual Studio runtime libraries ? Do I need to deploy those with my application ?
    J-P Nurmi

  3. #3
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application seems not to be linked statically

    Thanks for the quick replay (just five minutes after my question ).

    I acted as shown in the first link about building a static application. That is exactly what I did some days ago. I built a static Qt and afterwards a static application.
    It runs perfectly on my PC, but not on any other.

    Regarding your second link:
    Even Trolltech is using Dependency Walker . Following the link in the knowledge base there is a screenshot displaying about the same as I see with my application.

    It is still not working .

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Application seems not to be linked statically

    And you edited qmake.conf like this before building Qt? Changing -MD to -MT does the trick...
    J-P Nurmi

  5. #5
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application seems not to be linked statically

    Oops! No, I didn't.
    I will report, when my Qt is rebuilt incorporating these changes.

    [edit]
    Now happened what I feared. After about 30 minutes there was a linker error. Do the changes from here really work?

    [edit2]
    All clear . After deleting the whole Qt directory and rebuilding it from the original zip-file from Trolltech (I made the changes from here), there were no more linker errors.
    I even can compile a release version with "nmake release" that runs on the other PCs. That release version does not run on my PC. The debug version however runs on my PC but still not on the other PCs.
    But I can live with that strange behaviour .

    Many thanks for pushing me into the right direction.

    Kind regards
    Michael
    Last edited by Boron; 1st April 2008 at 23:49.

  6. #6
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Application seems not to be linked statically

    Why can't I edit my directly preceding post?

    Another solution for the problem in this thread might be to install the Microsoft Visual C++ 2005 Redistributable Package.

Similar Threads

  1. Please Help-->have few doubts with Static build in Windows !
    By Krish in forum Installation and Deployment
    Replies: 1
    Last Post: 17th March 2008, 15:37
  2. Statically linked QtSql modules
    By runderwo in forum Qt Programming
    Replies: 5
    Last Post: 10th September 2007, 23:43
  3. Replies: 1
    Last Post: 18th April 2007, 21:48
  4. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 09:52
  5. statically linked executable
    By smalls in forum Qt Programming
    Replies: 8
    Last Post: 11th February 2006, 03:09

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.