Setup QT Creator with Yocto Build

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setup QT Creator with Yocto Build

50,698 Views
Joerg-SH
Contributor III

bitbaked meta-toolchain-qt

Install it  with

~/yocto/build/tmp/deploy/sdk$ poky-eglibc-x86_64-arm-toolchain-qt-1.4.1.sh

Download Qtcreator from here http://qt-project.org/downloads

and Install it to Your home directory

edit the bin/qtcreator.sh

source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi
#! /bin/sh

makeAbsolute() {
    case $1 in
        /*)
            # already absolute, return it
            echo "$1"
            ;;
        *)
            # relative, prepend $2 made absolute
            echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
            ;;
    esac
}

....

To do it before "#! /bin/sh" is IMPORTANT!!!!

In QtCreator i set

Compiler as

               /opt/poky/1.4.1/sysroots/x86_64-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++

Qt version as

        

                     /opt/poky/1.4.1/sysroots/x86_64-pokysdk-linux/usr/bin/qmake

sysroot as

                    /opt/poky/1.4.1/sysroots/armv7a-vfp-neon-poky-linux-gnueabi

Put them in a Kit

For connection to Your Board click on  Device  --->    Manage

Build a new project

and add some to the .pro file

Building the image for Your Board:

add        

TOOLCHAIN_HOST_TASK_append = " nativesdk-python-subprocess"

EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh"

to Your localconfig

bitbake core-image-sato-sdk

set a password to root  via

ssh root@[boardip]

passwd

test connection via

sftp  root@[boardip]

start qtcreator

./qtcreator.sh

Message was edited by: Joerg Boge

Nachricht geändert durch Joerg Boge Thanks to Diego Gonzalez

Labels (3)
Tags (3)
28 Replies

7,793 Views
wangvictor
Contributor III

Dear Joerg-SH:

I using qmake to get the Makefile like this.

../../sysroots/i686-pokysdk-linux/usr/bin/qt5/qmake -spec ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/devices/linux-imx6-g++/ -o Makefile test.pro

It is no problem when i qmake.

But when i make my Makefile it will show the error like below:

arm-poky-linux-gnueabi-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=softfp -O2 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5 -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore -I. -I. -I../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/devices/linux-imx6-g++ -o main.o main.cpp
In file included from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtGui/qwindowdefs.h:37:0,
from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/qwidget.h:37,
from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/qmainwindow.h:37,
from ../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtWidgets/QMainWindow:1,
from mainwindow.h:4,
from main.cpp:1:
../../sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi/usr/include/qt5/QtCore/qglobal.h:39:21: fatal error: cstddef: No such file or directory
compilation terminated.
make: *** [main.o] Error 1

I'm using qt5.5 to develop my application and Ubuntu 14.04 for my OS.

I don't know why this will happened.

Please Help!

0 Kudos

7,793 Views
tasi
Contributor I

Dear Joerg,

When i build a QT sample on Kit Warp7 occurs error: "/usr/bin/ld: cannot find -lQt5Core"
I had edited qtcreator.sh: source /opt/poky/2.1.2/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
but error still occur.

Any solution?

Thank you,
Ta Si

0 Kudos

7,794 Views
alejandroacosta
Contributor I

Hi everibody, i work with cross-compiled with imx6, but i have a problem with qmake, i download de toolchain armv7a in this link Index of /releases/yocto/yocto-2.0/toolchain/x86_64/, but in the moment of run, don't create the qmake for cross-compiler, someones help me please, regards...

0 Kudos

7,794 Views
sachusanal
Contributor III

Hai  Joerg ,

I followed your steps for the Qt creater configuration  for yocto build.

I bitbake meta-toolchain-qt.

then installed the tool chain. and edit qt creator .sh as per the above step

I  configure in my qt creator

Compiler as

              /opt/poky/1.6.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++

Qt version as

       

/opt/poky/1.6.3/sysroots/x86_64-pokysdk-linux/usr/bin/qt5/qmake

sysroot as

/opt/poky/1.6.3/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi

But I get an error like  could not start process.

I here by attach my error  log  please find out, and help me to solve this error

Regards

Sachu

0 Kudos

7,794 Views
强王
Contributor IV

Dear All:

source  setup-environment

MACHINE=imx6qsabresd source fsl-setup-release.sh -b build -e fb

bitbake meta-toolchain-qt5

QT SDK build sucessful

7,818 Views
威宁
Contributor I

Hello Joerg-SH

     I follow your step to setup QT.

$cd /home/wangq/work/yocto/fsl-release-bsp/sources/poky

$source oe-init-build-env

$bitbake meta-toolchain-qt

But there were some errors.


| collect2: ld returned 1 exit status

| make[1]: *** [lto1] Error 1

| make[1]: Leaving directory `/home/wangq/work/yocto/fsl-release-bsp/sources/poky/build/tmp/work/x86_64-pokysdk-linux/gcc-crosssdk/4.8.2-r0/gcc-4.8.2/build.x86_64-linux.x86_64-pokysdk-linux/gcc'

| make: *** [all-gcc] Error 2

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at /home/wangq/work/yocto/fsl-release-bsp/sources/poky/build/tmp/work/x86_64-pokysdk-linux/gcc-crosssdk/4.8.2-r0/temp/log.do_compile.8418)

ERROR: Task 547 (/home/wangq/work/yocto/fsl-release-bsp/sources/poky/meta/recipes-devtools/gcc/gcc-crosssdk_4.8.bb, do_compile) failed with exit code '1'


And I want to know this file(poky-eglibc-x86_64-arm-toolchain-qt-1.4.1.sh) came from where? I am new to all of this and any help would be greatly appreciated. Thanks

0 Kudos

7,817 Views
alvind
Contributor III

Hello,

After "bitbake meta-toolchain-qt", I ran the script "poky-eglibc-x86_64-meta-toolchain-qt-cortexa9hf-vfp-neon-toolchain-qt-1.5.3.sh ", can you check if this script is in your /build/tmp/deploy/sdk/ directory?

0 Kudos

7,794 Views
强王
Contributor IV

Dear  Dizon:

     if i want get poky-eglibc-x86_64-meta-toolchain-qt-cortexa9hf-vfp-neon-toolchain-qt-1.5.3.sh

     the current dir is ~/work/yocto/fsl-release-bsp

     the step :

     1:source setup-environment

     2:MACHINE=imx6qsabresd source fsl-setup-release.sh -b build -e fb

     3:bitbake meta-toolchain-qt

      is it right ?

0 Kudos

7,794 Views
alvind
Contributor III

Hello Qiang Wangq,

I actually used a somewhat different method, I just do ". setup-environment build-x11" and then go straight through "bitbake meta-toolchain-qt". Maybe you can try your method and update us with your results.

Thanks

0 Kudos

7,801 Views
威宁
Contributor I

Hi

There is something error  in the execution bitbake meta-toolchain-qt command ,and I can not find this file(poky-eglibc-x86_64-arm-toolchain-qt-1.4.1.sh).

0 Kudos

7,794 Views
alvind
Contributor III

Maybe you can post the contents of /home/wangq/work/yocto/fsl-release-bsp/sources/poky/build/tmp/work/x86_64-pokysdk-linux/gcc-crosssdk/4.8.2-r0/temp/log.do_compile.8418, so we can see the error.

Thanks

0 Kudos

7,818 Views
alvind
Contributor III

Hello Joerg-SH and thank you for this guide. I am using Qt 3.3 have followed your steps to setup Qt creator, and I have a few questions:

1) In specifying the kit, in the compiler tab there is an option for specifying the compiler path and make path. For the compiler path, I used "/opt/poky/1.5.3/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++" but I do not know what to put into the make path, do I just put the normal directory for the make utility?

2) I am using the latest Qt and Qt Creator, but after "bitbake meta-toolchain-qt", I think the version for Qt located within the sysroots folder is 4.8.5. Would this be OK?

I am new to all of this and any help would be greatly appreciated. Thanks

0 Kudos

7,818 Views
DipenPatel1z
Contributor III

Hi Joerg-SH,

Thanks for detailed explanation.

However I noticed that if SDK is installed at path other than default installation path then specifying Qt version in qtcreator doesn't work. I get "Invalid Qt Version" error.

I run qmake -query command and found that all variables point to default SDK installation path and not at where SDK is installed.

Do you have any idea how to solve this?

Regards,

Dipen Patel

0 Kudos

7,818 Views
ricercasviluppo
Contributor I

Hi guys,

does the meta-toolchain-qt has support for phonon?

0 Kudos

7,818 Views
jayrao
Contributor I

Hi Joreg / Everybody,

I follow the same exact step as mentioned above (with same version of QT creator) ,

but I endup getting ABI detection failed in QT version tab ( i selected qmake2) and it throws exception

Screenshot from 2013-11-10 21_05_54.png

I tried clean install many times, but each time its the same.

Any input  on this regard will be highly appreciated.

Thanks

0 Kudos

7,818 Views
Joerg-SH
Contributor III

Hello Jay,

thats "normal" should work properly with that!

If not than should be the mistake on an other place.

regards

Joerg

0 Kudos

7,818 Views
jayrao
Contributor I


Thank you very much Joreg, let me try and see if everything goes fine.

Thanks.

0 Kudos

7,818 Views
jayrao
Contributor I

Hi Joreg,

Now I stumble on this when I try to build  (QT creator 2.8)


qtbuilderro_perdenied.JPG

qt2.JPG

The below thread indicated that the follwing env variables has to be set

http://qt-project.org/forums/viewthread/29456

qtenv.JPG

qtbuildenv.JPG

Joreg, do you happen to know if its necessary to add variables in the project build option ?

Thank you .

0 Kudos

7,818 Views
Joerg-SH
Contributor III

There is no need to do that

only

edit the bin/qtcreator.sh

source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi
#! /bin/sh

and start i with it

0 Kudos

7,818 Views
jayrao
Contributor I

Got it, Thank you Joreg :smileyhappy:

0 Kudos