Building Qt from source on OS X 10.10 - qt

I've tried to build a minimalist framework using qt-opensource-mac-x64-clang-5.4.0-beta.dmg with:
./configure -silent -nomake examples -nomake tests -platform macx-clang
but the build process fails miserably:
../../../src/3rdparty/chromium/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm:891:26: error: cannot initialize a parameter of type 'id<NSFileManagerDelegate>' with an rvalue of type 'PtrType' (aka 'ChromiumWebCoreObjCWebScrollbarPainterDelegate *')
[painter setDelegate:m_verticalScrollbarPainterDelegate.get()];
The latest sources in git also give this error, even if I remove the bogus module with -skip qtwebkit -skip qtwebkit-examples. Any ideas how to get it working?

This is from QtWebEngine so try
-skip qtwebengine

If you don't have specific requirements, it's best to let homebrew handle the details. I recently compiled pyqt, which also needs qt and it worked fine on OSX 10.10:
brew install qt

Related

QML module not found (QtQuick.Studio.Components 1.0 )

I cross compiled Qt 5.14.1 for my Raspberry pi 4 on a Ubuntu 18.04,
for my application I need arcs when I searched I found out that arc belongs to QtQuick.Studio.Components 1.0 https://doc.qt.io/qtdesignstudio/qml-qtquick-studio-components-arc.html
but when I added the import QtQuick.Studio.Components 1.0 in my main.qml I had an error QML module not found (QtQuick.Studio.Components 1.0 ) import paths : /opt/RaspberryQt/sysroot/usr/local/RaspberryQt/qml
so in my .pro file I added
QML_IMPORT_PATH = /opt/RaspberryQt/sysroot/usr/local/RaspberryQt/qml
but I still have this error
these are the libraries that I installed on my Raspberry pi 4 before cross compiling. Can you please tell me which one is missing ?
sudo apt-get build-dep qt5-qmake
sudo apt-get build-dep libqt5gui5
sudo apt-get build-dep libqt5webengine-data
sudo apt-get build-dep libqt5webkit5
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0 gdbserver
and this is my configuration
cd /opt/RaspberryQt/build
../qt-everywhere-src-5.14.1/configure -release -opengl es2 -eglfs -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/RaspberryQt/tools/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf- -sysroot /opt/RaspberryQt/sysroot -prefix /usr/local/RaspberryQt -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtwebengine -nomake tests -nomake examples -make libs -pkg-config -no-use-gold-linker -v -recheck
Thank you in advance
I was able to fix this problem. First install Qt Design Studio (you can add components to the Qt installation by going to the Qt install directory, such as C:\Qt and running MaintenanceTool.exe.
Once installed, navigate to following path in the Qt install directory:
[Wherever Installed]\Qt\Tools\QtDesignStudio\bin\qml\QtQuick
Then in there, copy the entire Studio folder, and paste it into:
[Wherever Installed]\Qt\Tools\QtCreator\bin\Qml\QtQuick
Then relaunch Qt Creator and it should see it.
Note: There might be a more elegant way to import the modules from Qt Design Studio by adding the [path]\Qt\Tools\QtCreator\bin\Qml\ directory to the import paths, but that wasn't working for me, so I just did it with the method above.
you are getting the import from an extra qt module. So compile and install https://codereview.qt-project.org/gitweb?p=qt-labs/qtquickdesigner-components.git;a=tree into the qt installation on your raoberry aswell.
Follow-up to ThioJoe's answer:
If you've already tried ThioJoe's approach but facing the same issue, try this:
 1. Copy the Studio folder located in:   [Wherever Installed]\Qt\Tools\QtDesignStudio\bin\qml\QtQuick.
 2. Paste the copied Studio folder into:   [Wherever Installed]\Qt\6.2.3\mingw_64\qml\QtQuick   (note, the 6.2.3 might
be different depending on your version).
 3. Relaunch QtCreator.

QT "Could not find the Qt platform plugin "xcb" "

I installed QT-everywhere 5.15 open-source for academic reasons, but I have failed to run a program.
Firstly, I compiled the necessary source files with make and installed the QT Creator, then I selected qmake for running programs inside it. When I tried to run an example program, I encounter this error:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/usr/lib/x86-64-linux-gnu"
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.
The program has unexpectedly finished.
The process was ended forcefully.
Then I looked into /usr/lib/x86-64-linux-gnu for finding the xcb plugin and set LD_LIBRARY_PATH=/usr/lib/x86-64-linux-gnu, but again the same error appeared.
What should I do to solve this problem?
1. Install requirements:
sudo apt install make g++ pkg-config libgl1-mesa-dev libxcb*-dev libfontconfig1-dev libxkbcommon-x11-dev python libgtk-3-dev
python is optional for QtQuick.
libgtk-3-dev optional if you want the GTK native theme for QtWidgets.
2. Configure:
./configure -opensource -confirm-license -nomake tests -nomake examples -prefix /path/to/install/dir
3. Compile:
make -j $(nproc)
make install

How to build qtwebengine from Qt 5.5 git source

I have followed the instructions on this page Building Qt 5 from Git to build Qt 5.5 from source. The source is in "~/qt5_source_built/qt5" and the Qt 5.5 built system is in "~/qt5_source_built/qt5.5-build". I have used the following config options :
~/qt5_source_built/qt5/configure -developer-build -opensource -no-gtkstyle -nomake examples -nomake tests
and then used "make -j4" to build the qt-5.5 system. The system builds OK.
I use CMake to develop applications for the Qt 5.5 built system. It works for the usual cases (e.g. could use qtwebkit). However, when I want to test the qtwebengine module on a new application, I find that there seems NO qtwebengine include files and library files under the "~/qt5_source_built/qt5.5-build/qtbase" directory.
I have tried to re-make the system using different targets :
make all -j4
make module-qtwebengine -j4
make module-qtwebengine-all -j4
but the console keeps outputing
... Nothing to be done for ...
and the qtwebengine include and library files still could NOT be found under the "~/qt5_source_built/qt5.5-build/qtbase" directory after the re-make.
I notice that the qtwebengine source files seems could be found in "~/qt5_source_built/qt5/qtwebengine/src" but I just could not build it using the "make" command.
Have I just missed the qtwebengine include and library files under the built directory ? If not, does anyone know how could I build qtwebengine using this Qt 5.5 git source ?
Thanks for any suggestion.
The following ended up working. I installed all of these prereqs. If they were missing, QtWebEngine wouldn't build. make module-qtwebengine usually printed out the reason it didn't build it:
sudo apt-get install bison build-essential flex gperf gyp \
libasound2-dev libbz2-dev libcap-dev libcups2-dev libdrm-dev \
libegl1-mesa-dev libfontconfig1-dev libgcrypt11-dev \
libglu1-mesa-dev libicu-dev libnss3-dev libpci-dev libpulse-dev \
libssl-dev libudev-dev libxcomposite-dev libxcursor-dev \
libxdamage-dev libxrandr-dev libxtst-dev ninja python ruby
Then I used the following configuration. Not sure if this is minimal but it worked:
./configure -release -opensource -confirm-license -shared \
-no-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -qt-freetype\
-icu -openssl -qt-xcb -opengl -gui -widgets -skip webkit \
-nomake examples
Note that I skipped webkit, and also I use -shared instead of -static since static linking of QtWebEngine is apparently not yet supported.

Error when cross compiling Qt 5.0.1 for the Raspberry Pi

I'm trying to cross compile Qt 5.0.1 (latest release at the moment) for my Raspberry Pi. My set up is as follows:
Operating System: Ubuntu 12.04 32-bit
Cross compiler: Built from crosstool-NG program, using the exact instructions found here
Raspberry Pi Operating System: Raspbian Wheezy 2013-02-09 (mounted at /mnt/raspberry-pi-rootfs)
Configure command:
./configure -no-pch -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/<myusername>/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- -sysroot /mnt/raspberry-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5-raspberry-pi -v
When I run the configure command, it always fails with the following error:
Could not determine the target architecture!
/mnt/raspberry-pi-rootfs/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
Anyone know what this means?
I have tried the latest pre-built Linaro Toolchain cross compiler from here, and Qt at least builds, but any program compiled with it causes SIGILL (illegal instruction) fault as soon as the program runs up, which I guess is because the pre-built cross compler I used is not targeting the right architecture.
Note:
I am aware cross compiling is fiendishly difficult, but I'd like to understand more about what is going on
I'm not sure what the exact cause of this message was, but I managed to sort out by using a pre-buils toolchain for the Raspberry Pi from here:
https://github.com/raspberrypi/tools

How can i Built Qt-Creator against Qt5, in Ubuntu 12.04?

I had an existing Qt4 installation on my ubuntu built using the "Software center". After that, I installed Qt5 from git using the default settings. Now, realizing that the Qt Creator version I had, was configured for Qt 4.8.1, I uninstalled it (using software center) and now i am looking for some guidance to re-build it and link against Qt5. From their blog, I have noticed that the latest version should be a part of Qt5 installation but I am unable to start it from the HUD in ubuntu, nor do i know of any command-line options to fire it up from the terminal. Thank you for your time.
Hate to just throw up a link, but this guy explains it well.. for multiple operating systems.
http://qt-project.org/wiki/Building_Qt_5_from_Git
You may refer to the Qt wiki.
An example procedure of build:
./configure -developer-build -opensource -nomake examples -nomake tests
./make
./make install
Your build target may be ARM or other platform,then you can use ./configure --help to see more configure help.

Resources