Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile error with Raspberry Pi OS Lite Bullseye #98

Closed
WalterPrech opened this issue Mar 30, 2022 · 2 comments
Closed

Cross compile error with Raspberry Pi OS Lite Bullseye #98

WalterPrech opened this issue Mar 30, 2022 · 2 comments
Labels
Question ❔ Query related to this project Solved 🎏 Goal Achieved!

Comments

@WalterPrech
Copy link

Hi,
I'm following the step-by-step instructions for cross compiling Qt for Raspberry Pi.

I set up a Raspberry Pi 4 with 32bit Raspberry Pi OS Lite. Also I set up a virtual machine with Ubuntu 20.04 LTS as host to cross compile.

On the Pi 4 I can't enable GL (FAKE KMS) with sudo raspi-config (there is no Advanced Options -> A8 GL Driver -> G2 GL (Fake KMS) available).
Also the directory /opt/vc is not available.

On the host PC, after the build configure, EGLFS Raspberry Pi is set to yes.

The make command ends up with the following errors:

/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp: In function ‘EGLNativeWindowType createDispmanxLayer(const QPoint&, const QSize&, int, DISPMANX_FLAGS_ALPHA_T)’:
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:74:5: error: ‘EGL_DISPMANX_WINDOW_T’ was not declared in this scope
   74 |     EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T;
      |     ^~~~~~~~~~~~~~~~~~~~~
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:74:28: error: ‘eglWindow’ was not declared in this scope; did you mean ‘QWindow’?
   74 |     EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T;
      |                            ^~~~~~~~~
      |                            QWindow
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:74:44: error: ‘EGL_DISPMANX_WINDOW_T’ does not name a type
   74 |     EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T;
      |                                            ^~~~~~~~~~~~~~~~~~~~~
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp: In function ‘void destroyDispmanxLayer(EGLNativeWindowType)’:
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:5: error: ‘EGL_DISPMANX_WINDOW_T’ was not declared in this scope
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |     ^~~~~~~~~~~~~~~~~~~~~
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:28: error: ‘eglWindow’ was not declared in this scope; did you mean ‘QWindow’?
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                            ^~~~~~~~~
      |                            QWindow
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:52: error: ‘EGL_DISPMANX_WINDOW_T’ does not name a type
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                                                    ^~~~~~~~~~~~~~~~~~~~~
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:74: error: expected ‘>’ before ‘*’ token
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                                                                          ^
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:74: error: expected ‘(’ before ‘*’ token
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                                                                          ^
      |                                                                          (
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:75: error: expected primary-expression before ‘>’ token
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                                                                           ^
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:84:84: error: expected ‘)’ before ‘;’ token
   84 |     EGL_DISPMANX_WINDOW_T *eglWindow = static_cast<EGL_DISPMANX_WINDOW_T *>(window);
      |                                                                                    ^
      |                                                                                    )
/home/user/rpi-qt/qt-everywhere-src-5.15.2/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm/qeglfsbrcmintegration.cpp:88:12: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
   88 |     delete eglWindow;
      |            ^~~~~~~~~
make[7]: *** [Makefile:1266: .obj/qeglfsbrcmintegration.o] Error 1
make[7]: Leaving directory '/home/user/rpi-qt/build/qtbase/src/plugins/platforms/eglfs/deviceintegration/eglfs_brcm'
make[6]: *** [Makefile:152: sub-eglfs_brcm-make_first] Error 2
make[6]: Leaving directory '/home/user/rpi-qt/build/qtbase/src/plugins/platforms/eglfs/deviceintegration'
make[5]: *** [Makefile:107: sub-deviceintegration-make_first-ordered] Error 2
make[5]: Leaving directory '/home/user/rpi-qt/build/qtbase/src/plugins/platforms/eglfs'
make[4]: *** [Makefile:128: sub-eglfs-make_first] Error 2
make[4]: Leaving directory '/home/user/rpi-qt/build/qtbase/src/plugins/platforms'
make[3]: *** [Makefile:105: sub-platforms-make_first] Error 2
make[3]: Leaving directory '/home/user/rpi-qt/build/qtbase/src/plugins'
make[2]: *** [Makefile:723: sub-plugins-make_first] Error 2
make[2]: Leaving directory '/home/user/rpi-qt/build/qtbase/src'
make[1]: *** [Makefile:51: sub-src-make_first] Error 2
make[1]: Leaving directory '/home/user/rpi-qt/build/qtbase'
make: *** [Makefile:85: module-qtbase-make_first] Error 2

Are there special configurations to do for cross compiling with Raspberry Pi OS Lite Bullseye and Pi 4?

Can you please give me some hints?

@WalterPrech
Copy link
Author

I found a solution/patch to complete cross compiling the Qt libraries for Raspberry Pi4.

Using this patch, solves the error:

--- a/qtbase/src/gui/configure.json	2021-12-07 09:49:39.810299326 -0600
+++ b/qtbase/src/gui/configure.json	2021-12-07 09:49:20.546298594 -0600
@@ -862,7 +862,10 @@
             "type": "compile",
             "test": {
                 "include": [ "EGL/egl.h", "bcm_host.h" ],
-                "main": "vc_dispmanx_display_open(0);"
+                "main": [
+                    "vc_dispmanx_display_open(0);",
+                    "EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T;"
+                ]
             },
             "use": "egl bcm_host"
         },

@abhiTronix
Copy link
Owner

@WalterPrech Thanks that will be helpful for others.

@abhiTronix abhiTronix added Question ❔ Query related to this project Solved 🎏 Goal Achieved! labels Mar 31, 2022
@abhiTronix abhiTronix pinned this issue Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question ❔ Query related to this project Solved 🎏 Goal Achieved!
Projects
None yet
Development

No branches or pull requests

2 participants