Results 1 to 14 of 14

Thread: Qt 5.1 Application doesnt start in windows !!!

  1. #1
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Qt 5.1 Application doesnt start in windows !!!

    Hi
    I release prject with Qt 5.1.0 for windows using Windows 32-bit (VS 2012, 511 MB) then I put necessary dll s Including plugin folder ( with this application
    And then I run application in my own pc every thing works fine but when I tried other pc that doesn't contain Qt it doesn't start (no error just doesn't show any thing !...)
    Things that I have done :
    I installed visual c++ 2012-210-2008 Redistrutable packages
    Putting all dll s even debug ones !
    Putting plugins folder
    not.jpg
    I tried dependency walker but it seems nothing is missing !!

    Note that I have same probem with mingw version of Qt 5.1 too !
    I tried using this qApp->setLibraryPath(dir);
    Thenit runs but still cant play sound (doesn't recognize multimedia dll this one I think dsengine.dll !!)
    I use QMediaPlayer and QSqlite in my application and I added all necessary dll s

    Any help?

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

    smemamian (14th July 2013)

  3. #2
    Join Date
    Mar 2013
    Posts
    45
    Thanks
    23
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    hi everybody

    I have same problem too, plz help

  4. #3
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Any help?!

  5. #4
    Join Date
    Sep 2011
    Location
    Bangalore
    Posts
    254
    Thanks
    92
    Thanked 16 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Did you create a folder called platforms inside your application directory and add qwindows.dll into that folder?

  6. #5
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Quote Originally Posted by rawfool View Post
    Did you create a folder called platforms inside your application directory and add qwindows.dll into that folder?
    Yes I do see the picture I attached...

  7. #6
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    copy all of contents of plugins folder into your app to see if works. Did you used qml module in your app? Did you used third party libs in your app?

    If you used qml, then you have to copy contents of qml folder into your app folder.

  8. #7
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    copy all of contents of plugins folder into your app to see if works.
    As I said,I tried it before.
    Did you used qml module in your app? Did you used third party libs in your app?
    No . I didn't use qml too.

  9. #8
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    You said that the sound is not playing and the app has launched. so the problem is not triggered by dll and i think it has to be the path. are u sure about path of your sound files? ( have u added it into your resources or gave it an absolute path?)
    Last edited by alizadeh91; 16th July 2013 at 09:33.

  10. #9
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Quote Originally Posted by alizadeh91 View Post
    You said that the sound is not playing and the app has launched. so the problem is not triggered by dll and i think it has to be the path. are u sure about path of your sound files? ( have u added it into your resources or gave it an absolute path?)
    QMediaPlayer cant play sound from resource and yes I give it absoulutePath base on QApplication::applicationDirPath() so it is not the problem!
    And No it doesnt start unless I put this line of codes in main (I must put application in c:/Setup in this way !)
    Qt Code:
    1. #include "mainwindow.h"
    2. #include <QApplication>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6.  
    7. qApp->setLibraryPaths(QStringList()<<"C:/Setup"<<"C:/Setup/plugins");
    8.  
    9. QApplication a(argc, argv);
    10.  
    11. MainWindow w;
    12. w.show();
    13.  
    14. return a.exec();
    15. }
    To copy to clipboard, switch view to plain text mode 


    Added after 22 minutes:


    I tried fllowing code and now every thing seems to work in other pc's except the music part(It doesnt use dsengine from plugin floder *I put the whole plugin folder in my application folder *!!!see this image !Wow!.jpg ) Maybe a bug in Qt?!
    Qt Code:
    1. #include "mainwindow.h"
    2. #include <QApplication>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QStringList split=QString(argv[0]).split("\\");
    7. split.removeAt(split.size()-1);
    8. QString path=split.join("\\");
    9.  
    10. qApp->setLibraryPaths(QStringList()<<path<<path+"\\plugins"<<path+"\\plugins\\mediaservice");//path+"\\plugins\\mediaservice" because dsengine.dll is located in mediaservice folder I tried with out it too!!
    11.  
    12. QApplication a(argc, argv);
    13.  
    14. MainWindow w;
    15. w.show();
    16.  
    17. return a.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images
    Last edited by omid_kma; 16th July 2013 at 11:25.

  11. #10
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Muhaha I fixed the problem !!!!!!
    The problem was that I used QMediaPlayer in static way ! (still seems a bug to me !)
    And now with using setLibraryPath everything works fine in other pc's
    Can any one explain me why this problem happens when I use QMediaPlayer in a static class?

    *Edit*
    It Works with out qApp()->setLibraryPaths() too
    Last edited by omid_kma; 16th July 2013 at 19:19.

  12. #11
    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: Qt 5.1 Application doesnt start in windows !!!

    If you were using a static Qt build (you would have had to build this yourself from source) then you lose the ability to load plugins at runtime. If you did not also build the necessary multimedia plugins into your executable then they were not available and nothing requiring the missing plugins would work.

    Of course, if you had actually built a static Qt then all this talk of deploying the correct DLLs is moot as they were not required. Simlarly, Dependency Walker would be happy because there are no Qt DLLs required: it does not identify plugins loaded unless you run a dynamically-linked program in profile mode.

    A dynamic program deployed in accordance with the docs does not require calls to setLibraryPath().

    @semamiam: you do not have exactly the same problem (although you appear to be doing exactly the same assignment) so I suggest you work your problem in the thread you started and then abandoned.

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

    omid_kma (31st July 2013)

  14. #12
    Join Date
    Jan 2013
    Location
    Iran
    Posts
    12
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Nopes you miss understand me I ment this as static QMediaPlayer (not static build)
    Qt Code:
    1. class test
    2. {
    3. static QMediaPlayer* player;
    4. }
    5. QMediaPlayer* test::player=new QMediaPlayer();
    To copy to clipboard, switch view to plain text mode 
    If you use this class then the program would not recognize plugins dll !
    .
    .
    .

  15. #13
    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: Qt 5.1 Application doesnt start in windows !!!

    Creating the object in the way you do above happens before main() and therefore before the application object comes into being. Chances are (I have not verified this) that QMediaPlayer requires the setup done by QCoreApplication.

  16. #14
    Join Date
    May 2017
    Posts
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qt 5.1 Application doesnt start in windows !!!

    Quote Originally Posted by alizadeh91 View Post
    copy all of contents of plugins folder into your app to see if works. Did you used qml module in your app? Did you used third party libs in your app?

    If you used qml, then you have to copy contents of qml folder into your app folder.
    I signed up just to thank you. You saved me. Qt can be such a nightmare! I spent hours trying to figure out why my app would launch but no GUI popped up. That was it. I use the windeployqt tool and it doesn't import the qml folder for you. Ugh what a horrid nightmare. Missed my project deadline because of it.
    Thank you.

Similar Threads

  1. QProcess Problem: Program doesnt start
    By musaulker in forum Newbie
    Replies: 5
    Last Post: 30th April 2020, 23:07
  2. Windows CE + Application does start
    By uygar in forum Installation and Deployment
    Replies: 0
    Last Post: 21st October 2011, 18:10
  3. Replies: 5
    Last Post: 13th March 2010, 14:03
  4. QWT doesnt show any windows
    By Cal in forum Qwt
    Replies: 5
    Last Post: 30th June 2009, 17:05
  5. Start Qt application as Windows Service
    By ^NyAw^ in forum Qt Programming
    Replies: 12
    Last Post: 10th May 2008, 17:23

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.