Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Windows Code -> Linux
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?
VanDerSam last edited by
First you should present error messages.
What is the exact message you're getting about the target rule?
Is this a qmake based project (does it have a .pro-file)? How did you build it on windows?
Guest 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.
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?
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.
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 = app
SOURCES += main.cpp
SOURCES += mainwindow.cpp
HEADERS += 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?
Are you, by chance, sharing the .pro.user file from your original build environment? If so, you shouldn't be.