Results 1 to 3 of 3

Thread: attach libraries to exe

  1. #1
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default attach libraries to exe

    Hi,

    my purpose is making my Qt app useable on other computers that have never seen Qt. There are some ways discussed here: http://www.qtcentre.org/wiki/index.p...t_Applications

    The static linking would be ok as it is not a big application, but that is unfortunatelly not for free, so I have to drop that idea.

    I can find and copy the nessesary dll-s (like QtCore4.dll ect), but there are still some needs. My application keeps searching for the .dll-s and .a-s that can be found here: c:\Qt\2010.05\qt\plugins\imageformats\
    And these files must be here, not anywhere else. Not in the folder of the executable, not in anything similar, exactly here. Which means also that if I have a previos Qt version installed that has everything let's say in c:\Qt\2009.05\... then my application works fine only if I rename that folder or if I copy the needed files into a properly named path, but than I'll have this structure:
    c:\Qt\2009.05\... (here everyting, this is the already installed qt)
    c:\Qt\2010.05\... (only necessary path and files)

    There would also be a way to make a proper installer which would create this c:\Qt\2010.05\qt\plugins\imageformats\ if it is not already given on the system, but it would be a better solution to make my application portable.

    So my question is:
    - is there a way to declare for the application a new location some specific libraries?
    - I'm on to learn this suggested NSIS, I guess there would be a way to define more than one installation folder. Or am I on a wrong way?

    Szilvi
    Szilvi

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

    Default Re: attach libraries to exe

    Static linking can be used for free software (and even closed source), check the license for the particulars.

    You should be able to just put the default libraries into the same folder as your executable and put imageformats in a directory off the executable (eg. "plugins\imageformats")

  3. #3
    Join Date
    Nov 2010
    Location
    Budapest, Hungary
    Posts
    125
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: attach libraries to exe

    thanks for the hint I think it was a "lost in the forest" case.
    I started to "reduce" the length of the path and the last one worked fine. I tried this before but I stopped one level upper, because I beleived hard somhow that the plugin folder should remain, but no, the solution is to have this file structure:
    myappfolder\
    -----myapp.exe
    -----QtCore4.dll
    -----QtGui4.dll
    -----libgcc_s_dw2-1.dll
    -----mingwm10.dll
    -----imageformats\
    ----------------------(whole content of c:\Qt\2010.05\qt\plugins\imageformats\ is copied)

    thanks again, sometimes saying "you should keep on trying that with some details changed" is the best help one can give.
    Szilvi

Similar Threads

  1. attach more widgets to a QScrollArea
    By franco.amato in forum Qt Programming
    Replies: 39
    Last Post: 19th January 2010, 16:47
  2. SQLITE ATTACH database
    By drescherjm in forum Qt Programming
    Replies: 8
    Last Post: 9th December 2009, 07:25
  3. QSharedMemory won't attach
    By MattPhillips in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2009, 15:45
  4. Cannot attach region manager
    By bhm in forum Qt Programming
    Replies: 2
    Last Post: 24th May 2006, 12:31

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.