Results 1 to 17 of 17

Thread: executable version

  1. #1
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default executable version

    Hello friends,

    normally I copy the libraries .dll for the folder together with the executable. And it always worked.
    However, I did a software for image processing, that use the QPixmap, QImage, math.h, libraries among others. And it not working.
    I copied the libraries .dll that are necessary for run without error, the software opens without error, but the image not open. And when I compile the code, he run and open the image without problem.

    How will I find the libraries are needed?

    Sorry my english.

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

    hakermania (9th October 2011)

  3. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    You probably need to deploy the Qt image format plugin(s) into the "imageformats" sub-directory.
    See one of the many times this has come up

  4. The following 2 users say thank you to ChrisW67 for this useful post:

    danilodsp (22nd September 2011), hakermania (9th October 2011)

  5. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,460
    Thanked 271 Times in 266 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: executable version


  6. The following user says thank you to Lesiok for this useful post:

    danilodsp (22nd September 2011)

  7. #4
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    I read about Deploying Qt Applications and realized that I want to do static linking.
    I read in the link of Chris, my software also has load jpge, and QPainter.
    I used:
    Qt Code:
    1. QApplication a(argc, argv);
    2. a.addLibraryPath("C:/QtSDK/Desktop/Qt/4.7.4/mingw/plugins");
    3. PDI w;
    4. w.show();
    5. return a.exec();
    To copy to clipboard, switch view to plain text mode 

    But not working.
    I do not understand what is really needed, I thought all the linking .dll was already done automatically by Qt.
    It seems complicated.

  8. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    If you were:
    normally I copy the libraries .dll for the folder together with the executable. And it always worked.
    then you have been using dynamic linking. If you are finding that images are not loading then you just need to copy another DLL or two to supply the image plugins. No code changes. It hasn't changed in difficulty at all.
    Qt Code:
    1. C:\Program Files\My Funky Program
    2. - program.exe
    3. - QtCore4.dll
    4. - QtGui4.dll
    5. - ...
    6. + imageformats
    7. - qjpeg4.dll
    8. - jgif4.dll
    9. - ...
    10. + sqldrivers
    11. - qsqlite4.dll
    To copy to clipboard, switch view to plain text mode 


    If you want to do static linking then you need to:
    • Build Qt for static linking (i.e. the -static configure option)
    • Modify your application to arrange static inclusion of the same image format plugins How To
    • Build your application
    • Deploy your application keeping an eye on your license requirements regarding source/relinking ability if your are using GPL/LGPL.

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

    danilodsp (25th September 2011)

  10. #6
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    Hi friend,

    I understand.
    Actually I want the dynamic linking. I kept copying and did not work, I thought I was doing something wrong or different than before, then searched but not found the problem.
    I copied everything of: (more than 60 .dll)
    C:\QtSDK\Desktop\Qt\4.7.4\mingw\plugins
    for my executable.

    When it did not work, I copied other .dll of other directories did not work.
    Sorry being boring, but I really do not know what's wrong.

  11. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    On the deployed machine:
    • Open a command prompt
    • Change directory to the application install directory
    • Execute "DIR /s /b"
    • Copy and paste the output here

  12. #8
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    follow:

    Qt Code:
    1. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug>DIR /s /b
    2.  
    3. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\dialogmedia.o
    4. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libgcc_s_dw2-1.dll
    5. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqcncodecs4.a
    6. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqcncodecsd4.a
    7. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqgif4.a
    8. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqgifd4.a
    9. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqglgraphicssystem4.a
    10. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqglgraphicssystemd4.a
    11. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqico4.a
    12. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqicod4.a
    13. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqjpcodecs4.a
    14. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqjpcodecsd4.a
    15. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqjpeg4.a
    16. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqjpegd4.a
    17. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqkrcodecs4.a
    18. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqkrcodecsd4.a
    19. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqmng4.a
    20. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqmngd4.a
    21. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqsvg4.a
    22. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqsvgd4.a
    23. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqsvgicon4.a
    24. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqsvgicond4.a
    25. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtiff4.a
    26. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtiffd4.a
    27. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtracegraphicssystem4.a
    28. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtracegraphicssystemd4.a
    29. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtwcodecs4.a
    30. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\libqtwcodecsd4.a
    31. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\main.o
    32. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\mediaimg.o
    33. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\mingwm10.dll
    34. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_dialogmedia.cpp
    35. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_dialogmedia.o
    36. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_mediaimg.cpp
    37. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_mediaimg.o
    38. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_pdi.cpp
    39. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_pdi.o
    40. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_sobre.cpp
    41. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_sobre.o
    42. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_vishist.cpp
    43. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\moc_vishist.o
    44. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\PDI.exe
    45. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\pdi.o
    46. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qcncodecs4.dll
    47. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qcncodecsd4.dll
    48. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qgif4.dll
    49. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qgifd4.dll
    50. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qglgraphicssystem4.dll
    51. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qglgraphicssystemd4.dll
    52. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qico4.dll
    53. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qicod4.dll
    54. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qjpcodecs4.dll
    55. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qjpcodecsd4.dll
    56. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qjpeg4.dll
    57. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qjpegd4.dll
    58. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qkrcodecs4.dll
    59. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qkrcodecsd4.dll
    60. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qmng4.dll
    61. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qmngd4.dll
    62. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qrc_img.cpp
    63. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qrc_img.o
    64. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qsvg4.dll
    65. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qsvgd4.dll
    66. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qsvgicon4.dll
    67. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qsvgicond4.dll
    68. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\QtCored4.dll
    69. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\QtGuid4.dll
    70. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtiff4.dll
    71. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtiffd4.dll
    72. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtracegraphicssystem4.dll
    73. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtracegraphicssystemd4.dll
    74. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtwcodecs4.dll
    75. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\qtwcodecsd4.dll
    76. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\sobre.o
    77. C:\Users\Danilo\Documents\Processamento de imagens\PDI-build-desktop\debug\vishist.o
    To copy to clipboard, switch view to plain text mode 

    Before, I had placed .dll's the most, unnecessary.


    Added after 8 minutes:


    When I do debug with Qt Creator then the program works, it loads the image (.jpg) on the label. But when I put the .dll in debug folder then the image does not load anymore.
    Even through the Qt Creator, then I delete the folder and do debug by Qt Creator to work.

    Capture.jpg
    Last edited by danilodsp; 4th October 2011 at 14:34.

  13. #9
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    I'm discovering something.
    I put my .exe in the folder:C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
    and it worked.
    It seems that there's something I need, I'll try to find out.


    Added after 14 minutes:


    YES!
    It's working.
    Thank you guys, I was copying some .dll (as mingwm10, libgcc_s_dw2-1, QtCored4 and QtGuid4) of other different folder. But it has to be all of:
    C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin
    I found through of a post by Chris.
    Thank you.

    Note: does not need plugins imageformats to work.
    Last edited by danilodsp; 4th October 2011 at 19:56.

  14. #10
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    You were not putting the various plugins in the correct folder with respect to the program executable anyway.

  15. #11
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    But now I have one problem.
    The program alone is working in my computer. For other computer, I have that copy all the .dll of the new computer.
    And not is working in computer without Qt.
    Last edited by danilodsp; 5th October 2011 at 16:01.

  16. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    But now I have one problem.
    The program alone is working in my computer. For other computer, I have that copy all the .dll of the new computer.
    And not is working in computer without Qt.
    I have taken my toy train locomotive to my friend's place but I didn't bring the track. Why doesn't my train go?

    Of course you need the Qt runtime libraries and plugins your application uses on the computer that you want to run your dynamically linked Qt application on. All the information you need is in this thread.
    Last edited by ChrisW67; 5th October 2011 at 23:32.

  17. #13
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    Can I separate everything they need (to work on a computer without Qt) along with my executable?

  18. #14
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    Deploying an Application on Windows
    You are dynamic linking. You need:
    • Your application and any DLL components that you have built
    • Any Qt DLL your application needs (at least QtCore4.dll, probably QtGui4.dll and others)
    • Any Qt plugins your application needs to support image formats, icon formats, database connections etc.
    • Any DLL required for your C++ compiler run time


    You need to adhere to the terms of the license under which you are using Qt and the LGPL for the components only licensed under those terms.

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

    danilodsp (7th October 2011)

  20. #15
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    Ok.
    Thank you.

    About:
    "Any Qt plugins your application needs to support image formats, icon formats, database connections etc."

    just add .dll of imageformats, icon formats, and other ... ?

  21. #16
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,552
    Thanks
    13
    Thanked 1,579 Times in 1,508 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: executable version

    Yes, but they need to be in subdirectories, e.g. as in my earlier post

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

    danilodsp (8th October 2011)

  23. #17
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: executable version

    yeah,

    I finally got it.
    It is running on any computer.
    Thank you Chris.

    I was not copying the subdirectories.

Similar Threads

  1. Creating an evaluation version or trial version
    By munna in forum General Discussion
    Replies: 9
    Last Post: 20th June 2015, 01:50
  2. Replies: 5
    Last Post: 26th August 2011, 19:08
  3. Help in the executable
    By mukunda in forum Qt Programming
    Replies: 6
    Last Post: 5th July 2011, 07:59
  4. Replies: 0
    Last Post: 11th August 2009, 09:38
  5. Replies: 5
    Last Post: 5th October 2008, 05:12

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.