8

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

5 Answers5

9

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

Zitro
  • 91
  • 1
  • 3
2

Mybe there was some error while your building qt from source, or something is missing. Try search QMainWindow.h in qt include dir. Seems like it is in /usr/local/qt4.8.2-armhf/include. For am example you can search like this find * /usr/local/qt4.8.2-armhf/include/ | grep QMainWindow.

0x35
  • 162
  • 4
0

First of all you need make sure, that cross compiler works, compile hello world: std::cout << "hi\n" and run on device using cross comipler gcc from command line.

Second step is making sure that qmake from cross compiled Qt works as expected, run /usr/local/qt4.8.2-armhf/bin/qmake path/to/your/pro/file && make if all works then next step

Third, at last configure your Qt Creator

Look here: http://developer.toradex.com/how-to/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux

You need set sysroot to right value, for example in my case this is:

/usr/local/oecore-i686/sysroots/armv7ahf-vfp-neon-angstrom-linux-gnueabi/

inside this directory there "bin" and "lib" full of arm executables and arm libraries, this is what "sysroot", it is part of your device file system cloned to your cross compiler, that help you link your applications. Also make sure that you set right path to qmake for cross compilation in Qt creator preferences, it should like this: /usr/local/qt4.8.2-armhf/bin/qmake

fghj
  • 8,898
  • 4
  • 28
  • 56
0

Perhaps your QT Creator version is out of date. Projects can become corrupted if you install a version of QT Creator that is incompatible with them. You can download the latest version of QT Creator in the Software Center.

You also need to make sure your QT is up to date. Check using the Software Updater.

I found this; you might want to take a look at it: derekmolloy.ie/beaglebone/qt-with-embedded-linux-on-the-beaglebone/#Source_Code

0

On windows check that your project folder doesn't have strange characters like: ( , ) or # ...

Tarek.Mh
  • 638
  • 10
  • 8