1 (edited by alexandre.Ribault 2019-06-30 15:14:07)

Topic: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Bonjour, 

je souhaite recompiler le projet chez moi, après avoir téléchargé les sources depuis de le git.
J'ai ouvert le projet avec Qtcreator, mais lorsque je demande à compiler j'ai une erreur qui s'affiche.
Il me dit qu'il me manque les modules :
- KwidgetAddons 
- KcoreAddons

Je ne sais pas comment les installer:-(
Je suis allé sur la page internet du "projet" KwidgetAddons  , pour le premier module, mais ça ne m'aide pas.

Je compte sur vous pour m'aider à me débloquer.
Faut-il configurer le projet depuis QT.
Faut réinstaller certain élément dans QT.
Autre chose ?

Je n'ai même pas commencé à regarder pour KcoreAddons

Merci d'avance
(je suis spekkio09)

2 (edited by stromie 2019-07-14 14:57:37)

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Install Qt Creator, MinGW and the latest Qt version using the online installer from qt.io i use the 5.12.4
Install cmake (https://cmake.org/install/)
Add gcc and cmake bin directories to PATH environment variable
SET QTPATH=C:\Qt\5.12.4\mingw73_32

Download cmake-extra-modules (https://github.com/KDE/extra-cmake-modules)

Unpack cmake-extra-modules


Build ecm
cd(path to ecm)
cmake -DCMAKE_INSTALL_PREFIX=%QTPATH% -G "MinGW Makefiles"
mingw32-make install

build kcoreaddons
download an unpacktkcoreaddons (https://github.com/KDE/kcoreaddons)
cd (path to kcoreaddons)
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=%QTPATH% -DCMAKE_PREFIX_PATH=$QTPATH -G "MinGW Makefiles" -DZLIB_LIBRARY:FILEPATH=C:\Qt\Tools\mingw730_32\i686-w64-mingw32\lib\libz.a
mingw32-make
mingw32-make install

build kwidgetsaddons

downloadan unpack kwidgetsaddons (https://github.com/KDE/kwidgetsaddons)

cd (path to kwidgetsaddons)
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=%QTPATH% -DCMAKE_PREFIX_PATH=$QTPATH -G "MinGW Makefiles" -DZLIB_LIBRARY:FILEPATH=C:\Qt\Tools\mingw730_32\i686-w64-mingw32\lib\libz.a
mingw32-make
mingw32-make install

rename C:\Qt\5.12.4\mingw73_32\lib\libKF5CoreAddons.dll.a to libKF5CoreAddons.a
rename C:\Qt\5.12.4\mingw73_32\lib\libKF5WidgetsAddons.dll.a to libKF5WidgetsAddons.a

3 (edited by Re-searcher 2020-08-18 16:02:40)

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

@stromie
ecm Cmake error with qt5.12.4

no mingw32-make file in qt5.12.4

C:\Users\test\Documents\ecm>SET QTPATH=C:\Qt\5.12.4\mingw73_32

C:\Users\test\Documents\ecm>
C:\Users\test\Documents\ecm>cmake -DCMAKE_INSTALL_PREFIX=%QTPATH% -G "MinGW Makefiles"
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.


CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!

C:\Users\test\Documents\ecm>

I am an pre-retired industrial developer technician and born in 1960

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

https://qelectrotech.org/wiki_new/doc/qt_pour_windows

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

mingw32-make is on C:\Qt\Tools\mingw810_64\bin\

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

@ Erik :
https://download.qelectrotech.org/qet/forum_img_2/Qt_install.png
https://download.qelectrotech.org/qet/forum_img_2/path.png
Install cmake (https://cmake.org/install/)
https://github.com/Kitware/CMake/releas … 64-x64.msi


Install CMAKE and chose add PATH for all users

Build ecm
Download cmake-extra-modules (https://github.com/KDE/extra-cmake-modules)

Unpack cmake-extra-modules

SET QTPATH=C:\Qt\5.12.4\mingw73_64

cd(path to ecm)

cmake -DCMAKE_INSTALL_PREFIX=%QTPATH% -G "MinGW Makefiles"
mingw32-make install

https://download.qelectrotech.org/qet/forum_img_2/ecm_cmake.png


build kcoreaddons
download an unpack tkcoreaddons (https://github.com/KDE/kcoreaddons)
cd (path to kcoreaddons)
mkdir build
cd build

cmake .. -DCMAKE_INSTALL_PREFIX=%QTPATH% -DCMAKE_PREFIX_PATH=$QTPATH -G "MinGW Makefiles" -DZLIB_LIBRARY:FILEPATH=C:\Qt\Tools\mingw730_64\x86_64-w64-mingw32\libz.a

https://download.qelectrotech.org/qet/forum_img_2/kcoreaddons.png
https://download.qelectrotech.org/qet/forum_img_2/kcoreaddons2.png

mingw32-make

https://download.qelectrotech.org/qet/forum_img_2/kcoreaddons3.png

mingw32-make install

https://download.qelectrotech.org/qet/forum_img_2/kcoreaddons4.png


build kwidgetsaddons

downloadan unpack kwidgetsaddons (https://github.com/KDE/kwidgetsaddons)

cd (path to kwidgetsaddons)
mkdir build
cd build

cmake .. -DCMAKE_INSTALL_PREFIX=%QTPATH% -DCMAKE_PREFIX_PATH=$QTPATH -G "MinGW Makefiles" -DZLIB_LIBRARY:FILEPATH=C:\Qt\Tools\mingw730_64\x86_64-w64-mingw32\libz.a

https://download.qelectrotech.org/qet/forum_img_2/kwidget.png

mingw32-make

https://download.qelectrotech.org/qet/forum_img_2/kwidget2.png

mingw32-make install

https://download.qelectrotech.org/qet/forum_img_2/kwidget3.png



https://download.qelectrotech.org/qet/forum_img_2/win_qt12.4.png

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

7 (edited by Re-searcher 2020-08-23 14:14:14)

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

@Laurent :

merci pour votre explication d'expert  ;  thanks for your explanation

cmake-extra-modules   =  construit  ;  builds
KcoreAddons  =  construit  ;  builds
KwidgetsAddons  =  construit  ;  builds

fichier source QET  =  builds   ;  source file QET  =  builds
dans les fichiers release .O et .cpp   e qelectrotech.exe  ; in file release .O and .cpp files and qelectrotech.exe


minw32-make install  fonctionne ; mingw32-make install  works


Que devez-vous faire pour installer le programme QET ?  ; What do you have to do to install the program ?
Version prête à l'emploi ?                                                ReadyToUse version ?

I am an pre-retired industrial developer technician and born in 1960

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

It 's packaging work.
You build in shared mode also you need to learn windeployqt to find DLL's to put in bin folder with .exe binary.
https://doc.qt.io/qt-5/windows-deployment.html
http://renaudguezennec.eu/index.php/201 … cation-qt/

https://qelectrotech.org/wiki_new/doc/d … lectrotech

https://qelectrotech.org/wiki_new/doc/d … mande_tree

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

9 (edited by scorpio810 2020-08-27 08:50:54)

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

After many false leads I finally managed to complete a static build of Qelectrotech on Windows.
Learning a lot, I guess. I didn't end up using my complete static build of Qt, jasper, kcoreaddons and kwidgetaddons...

Here is a partial description, if I get a chance to do a clean VM build I should be able to fill in any blanks.
This was on a Win7 box, I may try it on Win10 next.

The whole install/build should be scriptable.
It may be an idea to add it to the WiKi, where it can be polished and kept up to date?

--- Several attempts at posting later ---

So, the forum doesn't like URLs, and I couldn't post in-line, see attached text file for what I had written here!



1. Install Msys64
   Instructions at https://www.msys2.org/
   Download installer https://repo.msys2.org/distrib/x86_64/msys2-x86_64-20200720.exe
   
2. Install build environment with pacman ("pacman -Syuu" updates system, "pacman -S package_name" installs package)
   Or install as required when attemt builds!

3. Install Qt5 Static build (Probably want to install default shared build as well)
   pacman -S mingw-w64-x86_64-qt5-static

4. Install the extras required for Qet, kcoreaddons and kwidgetaddons
   Not currently available as packages, so have to build them yourself!
   Clone the msys2/MINGW-packages repo https://github.com/msys2/MINGW-packages somewhere local
   Fire up your Msys64 shell and:
   
   git clone https://github.com/msys2/MINGW-packages.git
   cd MINGW-packages
   cd mingw-w64-kcoreaddons-qt5
   KF5_VARIANT=static MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
   pacman -U mingw-w64-x86_64-kcoreddons-qt5-static-5.68.0-1-any.pkg.tar.zst
   cd ..
   cd cd mingw-w64-kwidgetsaddons-qt5
   KF5_VARIANT=static MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
   pacman -U mingw-w64-x86_64-kwidgetsaddons-qt5-static-5.68.0-1-any.pkg.tar.zst

5. Clone the qelectrotech main or mirror repo if not already done
   
   Details to be added:
   Run up qtcreator from your Msys64 shell
   Create a static build package, based on the static qmake
   Open the qelectrotech.pro project from the repo
   Attempt a build from qtcreator (which fails for me) (static, release only. debug is HUGE!)
   cd to the build directory where the qtcreator build failed
   mingw32-make
   Which (for me) succeeds, despite appearing to run exactly the same commands that failed from qtcreator!

Post's attachments

Attachment icon HowToBuildQetStaticQt.txt 2.29 kb, 373 downloads since 2020-08-27 

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

thanks David, I added you on Wiki if you want to add this.
You saw a different speed with my Windows packages based on MXE cross-compiler?

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Thanks David, I also added link here :
https://qelectrotech.org/wiki_new/doc/q … atic_build

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Maybe in the future we need to think about paying a registration key for a Windows developer account in order to sign our Windows QET packages?
https://docs.microsoft.com/fr-fr/window … s-and-fees

Installation of QET on Windows is a pain...
If somebodody have NSIS knowege to upgrade NSIS package to version 2-> 3, thanks and welcome.

https://git.tuxfamily.org/qet/qet.git/t … ws/QET.nsi
https://git.tuxfamily.org/qet/qet.git/t … /QET64.nsi

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

https://www.phoronix.com/forums/forum/p … -rome-cpus

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

scorpio810 wrote:

Installation of QET on Windows is a pain...
If somebodody have NSIS knowege to upgrade NSIS package to version 2-> 3, thanks and welcome.

What is the problem with Windows installer?
Have you found someone to help you?

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

bruce33 wrote:

What is the problem with Windows installer?
Have you found someone to help you?

No!
NSIS 2 version is now very old but upgrade scripts isn't easy and neccessary for Win 10.

https://git.tuxfamily.org/qet/qet.git/t … ws/QET.nsi
https://git.tuxfamily.org/qet/qet.git/t … /QET64.nsi

It's been more than 10 years since I put my hands in it, and 25 years since I have more Windows PC ...

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

i tried to compile for windows following your description:

cborn wrote:

   git clone https://github.com/msys2/MINGW-packages.git
   cd MINGW-packages
   cd mingw-w64-kcoreaddons-qt5
   KF5_VARIANT=static MINGW_INSTALLS=mingw64 makepkg-mingw -sLf

But i allways get stuck when building the kcoreaddons.
Always problems with qtpcre2. What can I do?

 WARNING: MINGW_INSTALLS is deprecated, use MINGW_ARCH instead
==>  MINGW_ARCH: mingw64
  -> Building mingw64...
==> Making package: mingw-w64-kcoreaddons-qt5-static 5.116.0-1 (Sat Jul 27 20:16:54 2024)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found kcoreaddons-5.116.0.tar.xz
  -> Found kcoreaddons-5.116.0.tar.xz.sig
==> Validating source files with sha256sums...
    kcoreaddons-5.116.0.tar.xz ... Passed
    kcoreaddons-5.116.0.tar.xz.sig ... Skipped
==> Verifying source file signatures with gpg...
    kcoreaddons-5.116.0.tar.xz ... Passed (WARNING: the key has expired.)
==> WARNING: Warnings have occurred while verifying the signatures.
    Please make sure you really trust them.
==> Extracting sources...
  -> Extracting kcoreaddons-5.116.0.tar.xz with bsdtar
==> Starting prepare()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
--

CMake Error at C:/msys64/mingw64/qt5-static/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:91 (message):
  Library not found: qtpcre2
Call Stack (most recent call first):
  C:/msys64/mingw64/qt5-static/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:272 (_qt5_Core_process_prl_file)
  C:/msys64/mingw64/share/ECM/modules/ECMQueryQt.cmake:49 (find_package)
  C:/msys64/mingw64/share/ECM/kde-modules/KDEInstallDirs5.cmake:241 (include)
  C:/msys64/mingw64/share/ECM/kde-modules/KDEInstallDirs.cmake:15 (include)
  CMakeLists.txt:14 (include)


-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().
    Aborting...

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Maybe try to

git checkout 86ae34b987abedeb069cb9c7af17d0972de35f96

https://github.com/msys2/MINGW-packages … 972de35f96

https://qelectrotech.org/wiki_new/winstatic/winstatic

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

pacman -S binutils cmake git pcre2 patch gcc make ninja

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

A few notes in bulk...

   

     1  pacman -Syuu
     2  pacman -S binutils cmake git pcre2 patch
   24  git clean -d -x -f
   27  git checkout master
   28  cd mingw-w64-kcoreaddons-qt5
   
   30  gpg --recv-keys 58D0EE648A48B3BB
   
   32  pacman -Syu
   
   34  pacman -S mingw-w64-x86_64-qt5-base   
   36  KF5_VARIANT=shared MINGW_INSTALLS=mingw64 makepkg-mingw -sLf   
   39  pacman -U mingw-w64-x86_64-kcoreaddons-qt5-5.116.0-1-any.pkg.tar.zst
   40  cd ..
   42  cd mingw-w64-kwidgetsaddons-qt5
   43  KF5_VARIANT=shared MINGW_INSTALLS=mingw64 makepkg-mingw -sLf   
   45  pacman -U mingw-w64-x86_64-kwidgetsaddons-qt5-5.116.0-1-any.pkg.tar.zst
  
   58  pacman -S libsqlite-devel
   60  pacman -S mingw-w64-x86_64-qt5-svg
   51  git clone --recursive https://github.com/qelectrotech/qelectrotech-source-mirror.git
   53  cd qelectrotech-source-mirror/
   54  mkdir build && cd build
   61  C:/msys64/mingw64/bin/qmake.exe ../qelectrotech.pro
   68  C:/msys64/usr/bin/make.exe

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

in static it asks for qtprce2 it works in shared mode but the compilation doesn't work, I give up

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

actually I don't know why, but with your bulk nodes i could build kcoreaddons and kcoreaddons.
Make ended with
/KF5/KCoreAddons -I../../../../mingw64/include/QtCore -Irelease -I. -I/include -I../../../../mingw64/share/qt5/mkspecs/win32-g++  -o release/richtexteditor.o ../sources/richtext/richtexteditor.cpp
../sources/richtext/richtexteditor.cpp:912:10: fatal error: richtexteditor.moc: No such file or dire
ctory
  912 | #include "richtexteditor.moc"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile.Release:34912: release/richtexteditor.o] Error 1
make[1]: Leaving directory '/home/leade/qelectrotech-source-mirror/build'
make: *** [Makefile:45: release] Error 2

Re: How can i build in Windows QTcreator : KwidgetAddons KcoreAddons

Use MSYS2 MINGW64 terminal

    4  cd qelectrotech-source-mirror/build
    5  make.exe clean
    6  qmake.exe ../qelectrotech.pro
    9  C:/msys64/usr/bin/make.exe

I forgot to use -j48 arg to make... krrrr is so long to compile... pff
After see windeployqt.exe documentation for launching program..and add *.dll in /bin/qelectrotech.exe directory..
This is the disadvantage of compiling in shared mode...
https://wiki.qt.io/Deploy_an_Application_on_Windows
https://download.qelectrotech.org/qet/forum_img_2/windows_build_msys32.png


laurent@DESKTOP-7VLC119 MINGW64 /qelectrotech-source-mirror/build/release/bin
$ C:/msys64/mingw64/bin/windeployqt.exe qelectrotech.exe
C:\msys64\qelectrotech-source-mirror\build\release\bin\qelectrotech.exe 64 bit, release executable
Direct dependencies: Qt5Concurrent Qt5Core Qt5Gui Qt5Network Qt5PrintSupport Qt5Sql Qt5Svg Qt5Widget
s Qt5Xml
All dependencies   : Qt5Concurrent Qt5Core Qt5Gui Qt5Network Qt5PrintSupport Qt5Sql Qt5Svg Qt5Widget
s Qt5Xml
To be deployed     : Qt5Concurrent Qt5Core Qt5Gui Qt5Network Qt5PrintSupport Qt5Sql Qt5Svg Qt5Widget
s Qt5Xml
Updating Qt5Concurrent.dll.
Updating Qt5Core.dll.
Updating Qt5Gui.dll.
Updating Qt5Network.dll.
Updating Qt5PrintSupport.dll.
Updating Qt5Sql.dll.
Updating Qt5Svg.dll.
Updating Qt5Widgets.dll.
Updating Qt5Xml.dll.
C:\msys64\mingw64\bin\libGLESv2.dll does not exist.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."