Linux application not working on Windows
-
wrote on 19 Aug 2010, 20:16 last edited by
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.
-
wrote on 19 Aug 2010, 21:03 last edited by
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.
-
wrote on 19 Aug 2010, 21:46 last edited by
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)
-
wrote on 20 Aug 2010, 00:03 last edited by
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.
Thanks
-
wrote on 20 Aug 2010, 01:03 last edited by
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
-
wrote on 20 Aug 2010, 06:57 last edited by
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.
-
wrote on 20 Aug 2010, 13:08 last edited by
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.
-
wrote on 20 Aug 2010, 13:54 last edited by
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.
-
wrote on 20 Aug 2010, 13:58 last edited by
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.
-
wrote on 20 Aug 2010, 14:19 last edited by
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.
-
wrote on 22 Aug 2010, 21:33 last edited by
Sorry it took me so long, but I finally have the results. I can write to my home folder using the command line.
-
wrote on 23 Aug 2010, 15:15 last edited by
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?
1/12