Lazarus

Programming => Widgetset => QT => Topic started by: vfclists on April 01, 2016, 12:21:06 am

Title: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: vfclists on April 01, 2016, 12:21:06 am
How can I compile the whole the latest Qt 4.8.x widget set for Windows?

I have a mishmash of Qt 4.8.x DLLs cobbled together from different locations and different dates, together with the mingxxx.dll dependencies and they seem to work.

What I want now is to obtain them and all their dependencies from a certified location and get them to work, or compile them myself. Is there some standard approved location for them? If I want to compile them myself how do I get started?
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: mig-31 on April 01, 2016, 10:07:11 am
Hi,

If you are talking about Lazarus with Qt widgets, Lazarus installation copy qt.dll to C:\Windows\system or system32 directory. Set your project to compile/build with Qt widgetset.
This dll you should distribute with your FreePascal/lazarus application.
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: Leledumbo on April 01, 2016, 10:27:28 am
What I want now is to obtain them and all their dependencies from a certified location and get them to work, or compile them myself. Is there some standard approved location for them? If I want to compile them myself how do I get started?
https://download.qt.io/official_releases/qt/4.8/, pick one according to C/C++ compiler toolchain you'd like to have as dependencies (their runtime libraries, to be exact). Otherwise, building from source is clearly documented inside the archive.
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: zeljko on April 01, 2016, 10:54:43 am
Thing I'm doing for devel (cross from linux, but sometimes running lazarus qt under win): Normal mingw installation of qt into some folder, copy all needed dll-s into eg C:\Qt4.XX and add it to the path, and then deinstall Qt installation.
For deployment: all needed dll's go inside application dir, so I don't touch C:\Windows\System at any time.Updating Qt version is easy, just push update into appdir, instead of updating each client machine.
Besides that from Qt >= 4.8.6 you must rebuild qt4pas.dll because it wont' work with precompiled dll from official bindings page since they changed mingw version for >= 4.8.6 build and some symbols cannot be found in qt4pas.dll
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: vfclists on April 01, 2016, 01:10:56 pm
This is what I have just done. Installed Qt Creator, Qt SDK and the MingW32 compiler and simply copied the DLLs from from c:\Qt\487\bin directory and placed them in a directory with qt4pas5.dll. I am currently using two qt5pas5.dlls,  one from Derit and the other from the CodeLibrarian package, that were attached to this thread http://forum.lazarus.freepascal.org/index.php?topic=24606.25.

Besides that from Qt >= 4.8.6 you must rebuild qt4pas.dll because it wont' work with precompiled dll from official bindings page since they changed mingw version for >= 4.8.6 build and some symbols cannot be found in qt4pas.dll

This is the part I want to understand about rebuilding for Qt >= 4.8.6. Does this require a patched qt4.pas and some other units or libraries for linking? Is everything built with Lazarus or do you have to generate some object file and have it linked with the Mingw32 compiler?

Are the Qt DLLs required to build qt4pas5.dll or are they simply packaged with it for deployment? I don't see anything in qt4.pas that indicates that the Qt DLLs are required, unless they are for debugging purposes.


Thing I'm doing for devel (cross from linux, but sometimes running lazarus qt under win): Normal mingw installation of qt into some folder, copy all needed dll-s into eg C:\Qt4.XX and add it to the path, and then deinstall Qt installation.
For deployment: all needed dll's go inside application dir, so I don't touch C:\Windows\System at any time.Updating Qt version is easy, just push update into appdir, instead of updating each client machine.
Besides that from Qt >= 4.8.6 you must rebuild qt4pas.dll because it wont' work with precompiled dll from official bindings page since they changed mingw version for >= 4.8.6 build and some symbols cannot be found in qt4pas.dll
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: Leledumbo on April 01, 2016, 07:16:24 pm
Are the Qt DLLs required to build qt4pas5.dll or are they simply packaged with it for deployment? I don't see anything in qt4.pas that indicates that the Qt DLLs are required, unless they are for debugging purposes.
Since you're on Windows, no. Shared libraries are not required to be present (but you'll still get warnings from linker) when compiling / linking, only when executing.
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: zeljko on April 02, 2016, 09:47:01 am
You don't need any changes in qt4.pas, just build qt4pas.dll against .h files of qt >=4.8.6 , with mingw used to build qt >= 4.8.6.
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: vfclists on April 03, 2016, 11:24:40 pm
This is my first time of using QtCreator and I have no idea of how to go about it.

Do you have any ready made QtCreator projects which can do the compilation?

You don't need any changes in qt4.pas, just build qt4pas.dll against .h files of qt >=4.8.6 , with mingw used to build qt >= 4.8.6.
Title: Re: How can I compile the whole the latest Qt 4.8.x widget set for Windows?
Post by: Leledumbo on April 04, 2016, 08:39:00 am
This is my first time of using QtCreator and I have no idea of how to go about it.

Do you have any ready made QtCreator projects which can do the compilation?
QtCreator is not needed to build Qt nor qt4fpc. Simply configure + make for the former and qmake + make for the latter. Read README / INSTALL file in each archive.