PDA

View Full Version : Qt application from linux to windows



chs
17th November 2009, 09:41
Hello! I'm trying to develop an application in linux using QTCreator. It has a simple form with a button and a textedit. It works fine in linux but if I copy it to windows and I try to compile, appears some problems. How can I port a linux app to windows? I googled but i didn't find anything about this.

Thanks

calhal
17th November 2009, 10:30
It works fine in linux but if I copy it to windows and I try to compile, appears some problems.
What does it mean "problems"? How do you compile it? What's your compiler? Do you have some error messages? Give some more details.

chs
17th November 2009, 11:03
Im using QtCreator in windows, but i did the program in linux, using QtCreator too.
The error messages are like this one, and there are over 400:


undefined reference to 'ZN12QApplicationC!ERiPPci'
File not found: \home\chs\Escritorio\interfaz\main.cpp

I dont understand why it is looking for my linux home directory.

Tell me if you need more information

Thanks

calhal
17th November 2009, 11:24
Remove all Makefiles from your project directory, maybe it will help

chs
17th November 2009, 13:29
Thanks! I remove the debug files generated in linux: main.o, mainwindow.o and moc_mainwindow.o

Now is compiles but in QtCreator I have this message:



Starting ...

The process could not be started!


Then, i try to run it clicking in the .exe file but appears an error message because doesn't find "mingwm10.dll". Do you know what program must install?

thank you

calhal
17th November 2009, 13:37
Now is compiles but in QtCreator I have this message:


Starting ...

The process could not be started!


Maybe someone else will help you here, I don't know QtCreator to well, especially on Windows.


Then, i try to run it clicking in the .exe file but appears an error message because doesn't find "mingwm10.dll". Do you know what program must install?

You're compiling the code using MinGW which is part of QtSDK for Windows, so either add the directory containing this dll to your PATH or put it (the dll) in the same directory as your executable.

tsp
17th November 2009, 16:54
I have also seen similar behaviour and the reason for that was that the project settings were not correct! I see this behaviour if I copy folder (with source code and project files) from Ubuntu to Windows and try to compile the project.

The solution I used was that after I opened the project in Windows Qt Creator I immediately select Projects and then Run Settings and on the right side of Run configuration: press the '+' button and select your project from the drop-down list again. When selecting it again it corrects the working directory etc. and after that you can execute your application (at least this was a solution for me).

Before copying project from Linux to Windows remember to execute Build - Clean All, that will remove the object files etc.