Linux application not working on Windows

  • I created an application on Ubuntu 10.04, and it works fine on Ubuntu and other Linux distros, but when I move the source code to a computer with Windows Vista, the code compiles, but it doesn't run normally. When I run it from within the Qt Creator, it starts, but when I open it by double-clicking the exe file, I get an error message about a missing dll, and then the application crashes. Even when I run it from within Qt Creator, it claims that I don't have write permissions to my Desktop and Home folders.

    Any ideas will be greatly appreciated.

  • About dlls. You should have proper paths in your environment variables to folders with qt dlls or you can simply copy them into folder with exe-file.

  • You can find the missings dlls in C:\Qt\2010.04\qt\bin (if you have the 2010.04 version, the laste stable release), add this in your PATH enviroment variable or copy the dlls in the application folder, in this folder you can find, for example, QtCore4.dll and QtCored4.dll, the first is for application compiled in release mode and the second for debug mode

    (C:\Qt\2010.04\qt\bin is the default installation folder)

  • I checked again, and the dll is called mingwm10.dll. Where is this library?

    My main concern is really that Qt thinks that I don't have write permissions to my home folder, while in linux it retrieves the permissions perfectly.


  • All the dlls are in C:\Qt\2010.04\qt\bin\ and pay special attention in qt\ because you is easy to confuse with C:\Qt\2010.04\bin\

    about write permissions I see that problem when you try to compile your application whit the application running, may be some parts of your application are "running" try restarting, sometimes the solutions is change the compilation mode between debug and release try this to

  • mingwm10.dll is library from mingw. You can find it in mingw distribution in Qt SDK. Don't remember the path, but it is there.

  • Thank you for the answers. I'm sorry I wasn't clear about the permissions. What I mean is that when my application calls "QFileInfo(fileName).isWritable" it returns false.

  • Moderators

    What is the filename? Which path are you trying to write into? IIRC windows by default uses the directory the application is installed into as working directory instead of the home directory.

  • I am trying to retrieve the write permissions of "C:\Users\UserName", and isWritable returns false. Is this a bug in Qt? On Linux it works fine.

  • Moderators

    I am not sure, I currently do not have access to a windows box right now. It might actually be OK... Windows did get more secure since I last tried it:-)

    What does your "My Documents" directory return for isWritable? Can you create files in C:\Users\UserName, preferably using the command line? The windows explorer has special logic to request extended permissions, so its results may not be relevant.

  • Sorry it took me so long, but I finally have the results. I can write to my home folder using the command line.

  • When I call QFileInfo::isReadable about a file, it works fine. Maybe it is not valid for a directory?

    If that is the case, is there another way to find out if a directory is writable? Why is there no QDir::isWritable function?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.