Qt5 with Qt3D over Wayland rootfs

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

Qt5 with Qt3D over Wayland rootfs

20,370 Views
FranciscoCarril
Contributor V

First  Thanks to PrabhuSundararaj  for sharing his knowledge and tips to be able to accomplish all these steps.

With our new release of wayland coming soon, many of you would like to see it working with the latest Qt.  The process might sound complicated, but it is simpler than it seems.

Once you get in your hands the newest release sources then follow the MX6_Wayland_Weston_User_Guide_Review.pdf  for the instructions to install your Ltib and compile the rootfs.  I was successful creating the rootfs with Gnome profile selected.

Pay a lot of attention to step 8

8 Enabling Wayland/Weston Support for Prebuilt rootfs in

LTIB File System

The prebuilt root file system (rootfs) comes with prebuilt GPU driver. By default, it is set to EGL framebuffer. To enable

Wayland/Weston support, make EGL and GAL point to correct binaries as shown below:

$ ls –l $(ROOTFS)/usr/lib/libEGL.so

libEGL.so -> libEGL-wl.so

$ ls –l $(ROOTFS)/usr/lib/libGAL.so

libGAL.so -> libGAL-wl.so

The manual only advices to change libEGL.so link to libEGL-wl.so,  but you also have to change libEGL.so.1 link,  it should point to libEGL-wl.so as well.

ln -s  libEGL-wl.so  libEGL.so

ln -s  libEGL-wl.so  libEGL.so.1

ln -s  libGAL-wl.so  libGAL.so

Once building the rootfs is successful, please test that it boots correctly and start weston correctly.

$start-weston

$export LD_LIBRARY_PATH="/usr/lib"

$export XDG_RUNTIME_DIR="/tmp"

Proceed to QT5 build.  Please follow the guide to build QT5.

https://community.freescale.com/docs/DOC-94066

Pay attention that the rootfs now is the one created with the wayland release.

For example this  configure line:

./configure -opensource -confirm-license -make libs -device imx6 -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- -sysroot /home/b35153/waylandRootfs/ltib/rootfs -no-gcc-sysroot -prefix /opt/qt5wayland -no-pch -no-opengl -opengl es2 -no-xcb -make examples -make demos

After completing the guide, the next step is to build the Qtwayland plug-in.

1. Download the git repository for Qtwayland:

 

 

$ git clone git://gitorious.org/qt/qtwayland.git

   $ cd qtwayland


2. gedit src/plugins/platforms/qwayland-egl/qwayland-egl.pro

and make the change as like this, please be careful on not to break the syntax:

Delete these lines:

!contains(QT_CONFIG, no-pkg-config) {

    CONFIG += link_pkgconfig

    PKGCONFIG += wayland-egl egl

    } else {

    LIBS += -lwayland-egl -lEGL

}

Replace them with this line

LIBS += -lEGL

3. cd to <qtwayland directory>/qtwayland and run the qmake

(qmake should be in the PATH, or you can specify the full path to qmake)

$ qmake -r

   The qtwayland will test certain packages. The summary should look like this:

Checking for wayland... yes

Checking for xkbcommon... yes

Checking for brcm_egl... no

Checking for egl... yes

Checking for glx... no

Checking for wayland_egl... yes

Checking for xcomposite... no


If you have an error about the wayland-scanner not detected, disable the check at the qtwayland.pro


#!config_wayland_scanner {

#    error(QtWayland requires wayland-scanner)

#}


   4.  Build


make && sudo make install

Ater this step you should be able to run demos  using the wayland-egl platform like this:

$ ./forest_qml -platform wayland-egl

Now in order to install Qt3D follow this guide:

https://community.freescale.com/docs/DOC-94236

And

$./shaders -platform wayland-egl

Voila!

teapotQt.JPG

Labels (1)
Tags (4)
23 Replies

433 Views
GaoJianzhong
Contributor IV

Hi

I follow your steps to compile qt5+wayland.

It is ok to compile qt5,

But when i compile the qtwayland, there is a problem as bellow:

tte@ubuntu:~/Desktop/Linux/qtwayland$ ../qt-everywhere-opensource-src-5.0.2/qtbase/bin/qmake -r

Reading /home/tte/Desktop/Linux/qtwayland/src/src.pro

Reading /home/tte/Desktop/Linux/qtwayland/src/qtwaylandscanner/qtwaylandscanner.pro

Reading /home/tte/Desktop/Linux/qtwayland/src/plugins/plugins.pro

  Reading /home/tte/Desktop/Linux/qtwayland/src/plugins/platforms/platforms.pro

   Reading /home/tte/Desktop/Linux/qtwayland/src/plugins/platforms/wayland_common/wayland_common.pro

/home/tte/Desktop/Linux/qtwayland/src/plugins/platforms/wayland_common/wayland_common.pro:70: Cannot find feature qt_common

   Reading /home/tte/Desktop/Linux/qtwayland/src/plugins/platforms/qwayland-egl/qwayland-egl.pro

Reading /home/tte/Desktop/Linux/qtwayland/examples/examples.pro

Reading /home/tte/Desktop/Linux/qtwayland/tests/tests.pro

Reading /home/tte/Desktop/Linux/qtwayland/tests/auto/auto.pro

  Reading /home/tte/Desktop/Linux/qtwayland/tests/auto/client/client.pro


And when i do the make, I get following error:

te@ubuntu:~/Desktop/Linux/qtwayland$ make

cd src/ && ( test -e Makefile || /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/bin/qmake /home/tte/Desktop/Linux/qtwayland/src/src.pro -o Makefile ) && make -f Makefile

make[1]: Entering directory `/home/tte/Desktop/Linux/qtwayland/src'

cd qtwaylandscanner/ && ( test -e Makefile || /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/bin/qmake /home/tte/Desktop/Linux/qtwayland/src/qtwaylandscanner/qtwaylandscanner.pro -o Makefile ) && make -f Makefile

make[2]: Entering directory `/home/tte/Desktop/Linux/qtwayland/src/qtwaylandscanner'

g++ -c -pipe -O2 -fno-exceptions -Wall -W -D_REENTRANT -fPIE -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_BOOTSTRAP_LIB -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NO_TRANSLATION -DQT_QMAKE_LOCATION="/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/bin/qmake" -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/mkspecs/linux-g++ -I. -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/5.0.2 -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/5.0.2/QtCore -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtXml -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtXml/5.0.2 -I/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtXml/5.0.2/QtXml -o .obj/release-shared/qtwaylandscanner.o qtwaylandscanner.cpp

In file included from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/qeventloop.h:1,

                 from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,

                 from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/qcoreapplication.h:1,

                 from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/QCoreApplication:1,

                 from qtwaylandscanner.cpp:41:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h:55: error: invalid use of incomplete type ‘struct QObject’

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qobjectdefs.h:235: error: forward declaration of ‘struct QObject’

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h: In member function ‘QEventLoopPrivate* QEventLoop::d_func()’:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h:57: error: ‘d_ptr’ was not declared in this scope

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h: In member function ‘const QEventLoopPrivate* QEventLoop::d_func() const’:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h:57: error: ‘d_ptr’ was not declared in this scope

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h: At global scope:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qeventloop.h:99: error: expected ‘)’ before ‘*’ token

In file included from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/qcoreapplication.h:1,

                 from /home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/QCoreApplication:1,

                 from qtwaylandscanner.cpp:41:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:69: error: invalid use of incomplete type ‘struct QObject’

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qobjectdefs.h:235: error: forward declaration of ‘struct QObject’

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h: In member function ‘QCoreApplicationPrivate* QCoreApplication::d_func()’:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:77: error: ‘d_ptr’ was not declared in this scope

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h: In member function ‘const QCoreApplicationPrivate* QCoreApplication::d_func() const’:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:77: error: ‘d_ptr’ was not declared in this scope

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h: In static member function ‘static QString QCoreApplication::translate(const char*, const char*, const char*, int)’:

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:209: error: return type ‘struct QString’ is incomplete

/home/tte/Desktop/Linux/qt-everywhere-opensource-src-5.0.2/qtbase/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:211: error: incomplete type ‘QString’ used in nested name specifier

make[2]: *** [.obj/release-shared/qtwaylandscanner.o] Error 1

make[2]: Leaving directory `/home/tte/Desktop/Linux/qtwayland/src/qtwaylandscanner'

make[1]: *** [sub-qtwaylandscanner-make_first-ordered] Error 2

make[1]: Leaving directory `/home/tte/Desktop/Linux/qtwayland/src'

make: *** [sub-src-make_first] Error 2

Do you have any ideas with this ?

Thank you

0 Kudos

433 Views
AbhijitPotnis
Contributor I

I am facing the same error at my end.

Where you able to get passed this error ? If so please let me know how ?

0 Kudos

433 Views
FranciscoCarril
Contributor V

Try building the wayland scanner manually, like Gavin-Li did.

0 Kudos