Results 1 to 7 of 7

Thread: Custom widget - Only works in Designer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    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: Custom widget - Only works in Designer

    There's a .a file and then there's the .dll
    Now I am not sure any more if MinGW creates a lib file as well, but I think it should. (so that other windows compilers will be able to links against the lib), but as I said, I am not sure any more (it has bin a while since I compiled a lib with MinGW under windows)

    So I just checked a bit here:
    Building the DLL

    To build the DLL use the following commands:

    g++ -c -DBUILDING_EXAMPLE_DLL example_dll.cpp

    g++ -shared -o example_dll.dll example_dll.o -Wl,--out-implib,libexample_dll.a

    The -DBUILDING_EXAMPLE_DLL compiler option causes the DLL's functions to be declared as "dllexport", meaning that they will be "exported" from the DLL and available to client applications. The "-shared" option tells the linker to create a DLL instead of an .exe, and the "--out-implib" linker option causes an import library to be created, which is used later on.
    Note:

    The import library created by the "--out-implib" linker option is required iff (==if and only if) the DLL shall be interfaced from some C/C++ compiler other than the MinGW toolchain. The MinGW toolchain is perfectly happy to directly link against the created DLL. More details can be found in the ld info files that are part of the binutils package (which is a part of the toolchain).
    So if you are using MinGW, it actually link against the DLL it self, as stated here.

    So my guess is that you probably have a problem with paths somewhere or the like.

    EDIT: it just occured to me that you LIBS tag in the pro file was wrong:
    LIBS += -LD:\Anthony\Progs\Qt\plugins\designer\ -lPokerTableInfoPlugin
    ==========================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.

  2. The following user says thank you to high_flyer for this useful post:

    Darhuuk (8th January 2008)

Similar Threads

  1. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  2. QT4: Custom widget for QT Designer
    By Michiel in forum Qt Tools
    Replies: 4
    Last Post: 4th May 2006, 13:35
  3. Custom widget + Qt Designer
    By chombium in forum Qt Tools
    Replies: 1
    Last Post: 12th April 2006, 20:33
  4. Replies: 4
    Last Post: 1st March 2006, 23:11
  5. Replies: 4
    Last Post: 6th February 2006, 14:30

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.