Windows Code -> Linux
-
wrote on 27 Feb 2012, 19:15 last edited by
Hi. I have some Qt Widgets code (program) that I want to move to fedora 16. I have fedora 16 installed along with Qt SDK 32 bit.
The problem is when I try to just regularly open the project file, I can't build. It's telling me something about no target rule.
What is the standard procedure for using Qt Code originally written in Windows to run in linux?
Thanks,
mrstarware -
wrote on 27 Feb 2012, 19:23 last edited by
First you should present error messages.
-
wrote on 27 Feb 2012, 19:24 last edited by
What is the exact message you're getting about the target rule?
-
wrote on 28 Feb 2012, 09:28 last edited by
Is this a qmake based project (does it have a .pro-file)? How did you build it on windows?
-
wrote on 28 Feb 2012, 09:47 last edited by
My noob approach at porting my code to another platform is instead of using the original project and modify target rules I just create a new project and import all sources from the old project and let Creator do all the work for me. Usually, everything works just fine, without any modifications to the actual program source, tested this for apps I wrote in windows and successfully ported them to Linux and Android.
Yes, I know it is lame but IT WORKS :) That being said, there are more sophisticated and efficient ways to do it as well.
-
wrote on 28 Feb 2012, 21:22 last edited by
Hi, Sorry it took so long for me to reply. I have found the error. The .pro file was updated incorrectly, I'm assuming I added a file wrong. The problem now however, is that I have both updated that file and created a new project, and the GUI is still not correct. The project will now compile just fine, however, the Forms Builder data doesn't seem to have updated. I even copied and pasted directly on top of the old file in the folder in an attempt to make sure everything updated correctly. (Effectively I just replaced the form file) So how do I save form builder data across platforms?
Thanks,
mrstarware -
wrote on 28 Feb 2012, 21:35 last edited by
So long as your cpp files are listed in the SOURCES variable, and the .h files are in the HEADERS variable, and the .ui files are in the FORMS variable, you should pretty much be there.
-
wrote on 29 Feb 2012, 17:33 last edited by
Ok, so I was messing around with the .pro file again and then was able to build the gui in debug mode. However, when it's in release mode it still doesn't work? and I think I've done about as much editing to the .pro as I know how.
@#-------------------------------------------------Project created by QtCreator 2012-02-28T14:15:23
#-------------------------------------------------
QT += core gui
TARGET = MyProject
TEMPLATE = appSOURCES += main.cpp
SOURCES += mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui@
Is it possible that something isn't installed correctly? or that my QT Creator has a bad setting? Why can it build in debug but not switch to release?
Thanks again,
mrstarware -
wrote on 29 Feb 2012, 17:36 last edited by
Are you, by chance, sharing the .pro.user file from your original build environment? If so, you shouldn't be.
2/9