Mistakes in Build instruction

Post Reply
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

Some mistakes in build instruction
I tried to build QLC++ on my Windows 10 machine following the instruction on Windows Build QT5https://github.com/mcallegari/qlcplus/w ... -Build-Qt5.
I downloaded and installed the latest version of msys (msys2-x86_64-20230318.exe) from official site.
There are some outdated mistakes in the build instructions.
  • update-core is now deprecated, and it says "-bash: update-core: command not found"
  • gendef.exe and dlltool are not found.
More things to be coming.
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Have a look at this
https://github.com/mcallegari/qlcplus/b ... pveyor.yml

This is how every commit to QLC+ is built on Windows (and as you can see gendef and dlltool are there)
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Mon Mar 20, 2023 8:23 am Have a look at this
https://github.com/mcallegari/qlcplus/b ... pveyor.yml

This is how every commit to QLC+ is built on Windows (and as you can see gendef and dlltool are there)
The main issue is that I need to make some patches to QT5 library in Msys2 to compile with GCC.
I was using QT 5.15.8 withh QMake v3.1

Code: Select all

 # patch Qt 5.15.x to build with GCC 12
cd /c/msys64/mingw32/include/
sed -i -e 's/friend Q_CORE_EXPORT uint qHash/\/\/friend Q_CORE_EXPORT uint qHash/g' QtCore/qbitarray.h
sed -i -e 's/friend Q_NETWORK_EXPORT bool operator==/\/\/friend Q_NETWORK_EXPORT bool operator==/g' QtNetwork/qssldiffiehellmanparameters.h
In addition to this old change, I also needed to change the following files.
I am not quite sure if I did it right.
Maybe I need to use QtCreator instead of using Msys2 and Mingw64

In QtGui/qcolor.h file, comment the following two lines

Code: Select all

    friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &);
    friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
In QtCore/qtlocale.h file, comment line 1190

Code: Select all

friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) noexcept;
In QtCore/qregularexpression.h, comment line 171

Code: Select all

friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) noexcept;
In QtCore/qurl.h, comment line 364

Code: Select all

friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) noexcept;
In QtCore/qurlquery.h, comment line 112

Code: Select all

friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) noexcept;
In QtGui/qkeysequence.h, comment line 213 to 215

Code: Select all

    friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
    friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
    friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) noexcept;
In QtGui/qpen.h, comment line 120 to 121

Code: Select all

    friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
    friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
To be continued...
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Again, please have a look at what I mentioend before, from this line
https://github.com/mcallegari/qlcplus/b ... or.yml#L48

However, please consider moving to Linux as a developer-friendly environment to build and debug.
Windows is not really a good choice to contribute to this project
macOS is halfway but still has deployment complications

[EDIT] moved this thread to the proper place
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Mon Mar 20, 2023 10:10 am Again, please have a look at what I mentioend before, from this line
https://github.com/mcallegari/qlcplus/b ... or.yml#L48

However, please consider moving to Linux as a developer-friendly environment to build and debug.
Windows is not really a good choice to contribute to this project
macOS is halfway but still has deployment complications

[EDIT] moved this thread to the proper place
I checked the yml file already.
Now I am going to move to Linux since I don't waste too long time on building DE.
However we really should update the instruction for Windows, at least we should mention that the instruction is outdated and can not actually follow it.
Otherwise, some other members will also waste time like me.
janosvitok
Posts: 1326
Joined: Mon Apr 13, 2015 7:05 am
Location: Bratislava, Slovakia
Real Name: Jano Svitok
Contact:

I'd suggest moving from qmake+make to cmake. It can build projects using whatever toolkit is available on a platform.
Last time I checked (few years ago) it was more or less official way to build QT applications.

With cmake it is possible to build for Windows using either make+gcc (as now) or using MSVC or even ninja + msvc (which is quite faster than msbuild).
For Linux it generates makefiles (as now) and for macOS it supports at least Xcode, most probably also make+clang/make+gcc.

QT Creator can work with cmake projects.

Cmake is included in MSVC installation.

The downside is that it is a huge effort to convert the qmake files to cmake and I'm not sure if it can be done incrementally - I suppose the code would
need to be rearranged slightly.

Just to be clear: The main point I'm making here is that with cmake, it would be quite easy to create build files for visual studio, much more familiar to windows
devs than make+gcc and certainly easier to install. Some packages might not be compatible with MSVS, but those can be disabled in the cmake config file,
so the basic QLC+ windows build (e.g. at least UI + artnet) could be "install QT, install Visual Studio, run cmake something, run cmake something2"

Jano
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

cmake is recommended for Qt 6 and QLC+ hasn't switch to it yet. Now times are more mature, so we can discuss about it.
There's a quite bad PR that was supposed to evolve but got closed that include porting to cmake
https://github.com/mcallegari/qlcplus/pull/1214
There might be effort but this can help
https://wiki.qt.io/CMake_Port/Porting_Guide
and this
https://pypi.org/project/qmake2cmake/

Not sure what is the sense of using MSVC when all dependencies come from MSYS2 (fftw, sndfile, flac, ogg, mad, libusb, etc)
Basically you need to disable audio and plugins, so build an almost useless QLC+ version
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Mon Mar 20, 2023 3:22 pm cmake is recommended for Qt 6 and QLC+ hasn't switch to it yet. Now times are more mature, so we can discuss about it.
There's a quite bad PR that was supposed to evolve but got closed that include porting to cmake
https://github.com/mcallegari/qlcplus/pull/1214
There might be effort but this can help
https://wiki.qt.io/CMake_Port/Porting_Guide
and this
https://pypi.org/project/qmake2cmake/

Not sure what is the sense of using MSVC when all dependencies come from MSYS2 (fftw, sndfile, flac, ogg, mad, libusb, etc)
Basically you need to disable audio and plugins, so build an almost useless QLC+ version
  • Will we need to upgrade from QT5 to QT6 for QLC++ 5?
    As far as I know, the current version of QLC++5 is using qt5.
    And I am wondering if we need to upgrade the version of QT.
    I guess there will be so many issues with upgrading the qt version.
    And QT6 is a commercial version, but not free.
    So we need to make a serious decision about it.
  • Next question. Don't we need to make the versions of the Development environment fixed?
    In the original building system using Msys2, it simply installs mingw32/mingw-w64-i686-qt5, and we will never know which version of qt5 it will install for us.
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

- QLC+ 5 on Qt 6 is just a no right now. QLC+ 4 on Qt 6 works already
And no. Qt 6 is not commercial. Only certain minor releases of LTS versions. Also, sources are available after some months of exclusivity (thanks to KDE yay!) so even those commercial versions can be built from sources. In fact MSYS2 delivers Qt 5.15.8 which was commercial when it was released
- No. Qt 6 is not a need (yet). Please let's stick to Qt 5 for some more time.
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Wed Mar 22, 2023 7:57 am - QLC+ 5 on Qt 6 is just a no right now. QLC+ 4 on Qt 6 works already
And no. Qt 6 is not commercial. Only certain minor releases of LTS versions. Also, sources are available after some months of exclusivity (thanks to KDE yay!) so even those commercial versions can be built from sources. In fact MSYS2 delivers Qt 5.15.8 which was commercial when it was released
- No. Qt 6 is not a need (yet). Please let's stick to Qt 5 for some more time.
Excuse me, but I am a bit confused.
  • 1. What is the difference between QLC++4 and 5?
    As far as I know, QLC++5 is still in the beta version.
    So is QLC++5 just an extension of QLC4++?
    And do I just need to build a CMake compilation system based on the current master branch?
  • 2. Just want to confirm, which version of QT are we going to use for building QLC++? If I didn't misunderstand, we will use qt5 at the moment for some more time, right?
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

QLC+ 4 UI is based on Qt Widgets
QLC+ 5 UI is based on QML
The engine is 95% shared between the two versions.
Both use qmake and need to be ported to cmake.
Qt6 support is already in place for QLC+ 4 and is in progress for QLC+ 5 (qmltoqt6 branch) This also needs to be included in the port to cmake.
So QLC+ 4 can be built on Qt 5.15.x or Qt 6.4.x while QLC+ 5 can be built only on Qt 5.14.x/5.15.x

I hope this clear things up
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Wed Mar 22, 2023 12:58 pm QLC+ 4 UI is based on Qt Widgets
QLC+ 5 UI is based on QML
The engine is 95% shared between the two versions.
Both use qmake and need to be ported to cmake.
Qt6 support is already in place for QLC+ 4 and is in progress for QLC+ 5 (qmltoqt6 branch) This also needs to be included in the port to cmake.
So QLC+ 4 can be built on Qt 5.15.x or Qt 6.4.x while QLC+ 5 can be built only on Qt 5.14.x/5.15.x

I hope this clear things up
Btw, I had to install some additional packages such as
  • qtdeclarative5-dev
  • libqt5svg5*
  • qt3d5-dev
  • qml-module-qtquick-controls
  • qml-module-qtquick-controls2
  • qml-module-qtquick-dialogs
in my Ubuntu 22 in addition to the packages in the build instruction while I was trying to build QLC++5 using qmlui.
Otherwise, we will get compile errors saying

Code: Select all

error: Unknown module(s) in QT: qml svg 3dcore 3drender 3dinput 3dquick 3dquickextras
Or get the following runtime errors.

Code: Select all

module "QtQuick.Controls" is not installed

Code: Select all

module "QtQuick.Dialogs" is not installed
Please check it and add it to the documents.

Please refer to the following links.
https://stackoverflow.com/questions/39 ... t-creator
https://stackoverflow.com/questions/21 ... in-qt-svg
https://forum.qt.io/topic/119057/can-t ... p-example
https://stackoverflow.com/questions/21 ... installed
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

The wiki for QLC+ 5 build says this:
It is recommended to use the official Qt versions available here: https://www.qt.io/download-open-source/
Using the Qt version provided by the OS led to issues in the past.
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

mcallegari wrote: Thu Mar 23, 2023 7:57 am The wiki for QLC+ 5 build says this:
It is recommended to use the official Qt versions available here: https://www.qt.io/download-open-source/
Using the Qt version provided by the OS led to issues in the past.
Got it, thanks.
I have some troubles while compiling the source code in Windows.
In some places, I can find code snippets as follows.

Code: Select all

    quint32 maxChannels = 512;

    /* Construct a map of unallocated channels */
    int map[maxChannels];
There is no "const" in front of quint32 and therefore it occurs a compile error.
I am curious how it can be compiled on Linux without compile error and which standards of C++ it uses in Linux.
I know various length arrays (VLA) is supported since C++11, and I tried to compile with C++11, but failed.
Some articles including OpenAI says
Variable-length arrays (VLAs) are not supported in MSVC. VLAs are a C99 feature, and MSVC only supports C89/C90 and C++ standards up to C++17.
After all, in order to compile QLC++ project using MSVC, we need to replace all of the VLA codes with other candidates such as vectors.
What do you think?
itaylifshitz
Posts: 8
Joined: Sun Mar 19, 2023 3:15 pm
Real Name: Itay Lifshitz

How do we handle 3rd party libraries such as portaudio, libusb, mad, sndfile, fftw3, libola, libolaserver in the CMake build?
My suggestion is to include the GitHub repositories of these projects as submodules in the QLC++ project.
And create CMakeList.txt files for these repositories so that they also can be compiled during building.
What do you think?
User avatar
mcallegari
Posts: 4727
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

Please, no. Those are external and independent projects that are not part of the build.
I do not intend to include builds of packages outside my control and introduce even more complexity.
Please leave things as they are and keep them as dev dependecies.
Post Reply