Results 1 to 6 of 6

Thread: Recompiled DLL now requiring libs

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Recompiled DLL now requiring libs

    Hello!

    Recently I was using a old version of MinGW, Qt Creator and Qt 4.8.1 to create and compile a .dll in the same format as the one explained in the English Wikipedia article about DLLs (). There was no usage of Qt at all, just C code (using that "extern "C"" thing). This .dll was then load at run time by an application, and everything run happy and fine.

    But now I updated by programmer tools (MinGW, QtCreator maybe and Qt to 5.1.0) and although I could compile my .dll all fine, when I run the library at run time two successive errors appear, both of them essentially saying that a given .dll was missing - namely, libstdc++-6.dll and libwinpthread-1.dll. When I included both libs in the same folder where my .dll is located, then once again everything run fine.

    My question, then, is: why do I need now to include those files - specially taking in consideration that before such wasn't required? And is there I way by witch I can revert this situation - compiling my lib with the current kit but without having to add those dlls with it?

    Thanks,

    Momergil

  2. #2
    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: Recompiled DLL now requiring libs

    Since we have no idea what compiler and linker commands you used to build your DLL we really cannot be specific. One library is specific to C++ so that's one clue. The other is probably required by the first, but it's hard to say.

    Oh, and BTW, if you are loading the DLL from a Qt application then these dependencies are probably from the Qt 5 libs and not your DLL.
    Last edited by ChrisW67; 15th August 2013 at 05:42.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Recompiled DLL now requiring libs

    Quote Originally Posted by ChrisW67 View Post
    Since we have no idea what compiler and linker commands you used to build your DLL we really cannot be specific. One library is specific to C++ so that's one clue. The other is probably required by the first, but it's hard to say.
    Well, regarding the compiler it's MinGW 4.8 32 bit (the new one). Regarding commands to build, these are the default that appear when you begin to create a dll. more specific: qmake: qmake.exe Lfmd-HIS-HSL.pro -r -spec win32-g++, Make: mingw32-make.exe in C:\Users\Endrigo\Desktop\Lfmd-HIS-HSL.

    Quote Originally Posted by ChrisW67 View Post
    Oh, and BTW, if you are loading the DLL from a Qt application then these dependencies are probably from the Qt 5 libs and not your DLL.
    Actually not, I'm loading it from a Borland Builder C++ 6 application, using Windows API functions (LoadLibrary, GetProcAddress, etc.). Just as it's in Wikipedia

    Btw, today I was going to use the system again and know it asked for another .dll: libgcc_s_dw2-1.dll. And that's at least funny...

  4. #4
    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: Recompiled DLL now requiring libs

    Have you dropped your DLL into Dependency Walker to see what it is dependent on in isolation form the application?

    If you are using QMake to build your completely non-Qt DLL for use in your non-Qt application (I wonder why) then ensure your PRO file has:
    Qt Code:
    1. CONFIG -= qt
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Recompiled DLL now requiring libs

    has... ?

    Yep, dependency walker tells about the need for libgcc_s_dw2-1 and libstdc++-6 dlls (libwinpthread-1.dll is not mentioned). But the point here is that before, such dependency didn't exist at all (as I was fully capable of running and using the DLL without the need for such libs to be in the same folder as my .dll).

  6. #6
    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: Recompiled DLL now requiring libs

    Quote Originally Posted by ChrisW67 View Post
    If you are using QMake to build your completely non-Qt DLL for use in your non-Qt application (I wonder why) then ensure your PRO file has:
    Qt Code:
    1. CONFIG -= qt
    To copy to clipboard, switch view to plain text mode 
    I don't know where that went because it was there to quote.

    You are complaining that your new Ferrari is built from Ferrari components when the Porsche you used to drive got by fine on Porsche components. You have changed Qt (4.8 to 5.1) and C++ compilers (probably gcc 4.4 to 4.8) and the new version is built and does things differently.

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

    Momergil (26th August 2013)

Similar Threads

  1. qmake LIBS
    By rrlangly in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2010, 01:29
  2. using third party libs
    By jay in forum Qt Programming
    Replies: 13
    Last Post: 14th April 2009, 16:52
  3. Linking against different Libs
    By AlphaWolf in forum Qt Programming
    Replies: 3
    Last Post: 10th February 2009, 16:25
  4. Burn libs
    By Elgrimm Esleborn in forum General Programming
    Replies: 2
    Last Post: 16th March 2006, 16:12
  5. use libs under qt4
    By raphaelf in forum Qt Programming
    Replies: 6
    Last Post: 27th February 2006, 18:59

Tags for this Thread

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.