QMainWindow: No Such File Or Directory

user5387687 picture user5387687 · Nov 3, 2015 · Viewed 16.9k times · Source

I'm using QT Creator 3.5.1 and QT 4.8.2 on Ubuntu 14.04 LTS host machine, I configured my BeagleBone Kit for ARM crosscompiling like this: QT for BeagleBone

I'm following these steps, but I'm getting an error when trying to compile the default QT project QMainWindow Error

Am I missing something? If it's not found, it is not located at place where compiler looks. How do you fix this?

Here is my project file

Picture of my project

Answer

Zitro picture Zitro · May 18, 2017

Using Qt 5.8.0 on Win 7 / MSVC2015x64bit;

I had the same issue and I found a way to fix it, even if its not the smartest:

1) Open your projectname.pro file

2) Between QT += core gui and greaterThan(QT_MAJOR_VERSION, X): QT += widgets paste QT += widgets so this part looks kinda like this:

... QT += core gui QT += widgets greaterThan(QT_MAJOR...

Save and close the .pro file and wait for Qt to automatic read the file-changes and updating itself.
(If you have deaktivated this try restart Qt)

Aswell as this - replacing the "X" at greaterThan(QT_MAJOR_VERSION, X): QT += widgets with the pre-version's number works fine for me. (X = your_major_version - 1)

(In case using Qt 5.x place a 4 instead of 5, using Qt 3.x replace 3 with 2 and so on...)

I dont know if this also works for other platforms...

I hope i could help at least 1 person who has the same issue. ;)

Greetings Zitro