Results 1 to 6 of 6

Thread: How to link a Qt .exe to a dll dynamically?

  1. #1
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default How to link a Qt .exe to a dll dynamically?

    I have a Qt application , app.exe . I want to link this app.exe to a dll, projdll.dll dynamically. How do I do that?

    Here's the code in app.pro :
    Qt Code:
    1. LIBS += ./include/projdll.lib
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to link a Qt .exe to a dll dynamically?

    Can you be a bit more specific?
    Do you want to know how DLL are linked in general?
    Do you want to know what project settings to set for DLL linking?
    Or maybe you have a problem with pro file settings?
    What is the problem you have, what have you done and what didn't work?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    156
    Thanks
    47
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to link a Qt .exe to a dll dynamically?

    Segmentation fault occurs when data from dll memory is passed to exe memory using stl vector .
    So I want to link both the exe and dll dynamically to see if the segmentation fault can be resolved.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to link a Qt .exe to a dll dynamically?

    DLL IS dynamically linked, thats what it stands for: Dynamically Linked Library.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to link a Qt .exe to a dll dynamically?

    and
    Segmentation fault occurs when data from dll memory is passed to exe memory using stl vector .
    This is in runtime, which means the danymic linkage is resolved ok.
    It seems you have a problem in the implement ion, either of the lib, or in your application, probably in your application, you are trying to access a NULL obj (your vector) or maybe you go over the vector bounds or similar.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Feb 2010
    Location
    Poland
    Posts
    27
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to link a Qt .exe to a dll dynamically?

    Qt Code:
    1. LIBS += -lprojdll -Linclude
    To copy to clipboard, switch view to plain text mode 
    Last edited by produktdotestow; 18th November 2010 at 17:52.

Similar Threads

  1. how to add tab dynamically
    By asish_cse in forum Newbie
    Replies: 2
    Last Post: 14th September 2010, 16:27
  2. Add a Qwidget dynamically
    By assismvla in forum Newbie
    Replies: 4
    Last Post: 3rd September 2009, 06:14
  3. Dynamically Add QCheckBox
    By ToddAtWSU in forum Qt Programming
    Replies: 0
    Last Post: 22nd January 2007, 19:00
  4. Dynamically resizing in QT 3
    By kroenecker in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2006, 18:37

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
  •  
Qt is a trademark of The Qt Company.