[Lazarus] How to build Lazarus in Qt?

zeljko zeljko at holobit.net
Sun Oct 16 08:47:39 CEST 2011


On Sunday 16 of October 2011 05:44:16 silvioprog wrote:
> Finally, I managed to compile Lazarus to Qt.
> 
> All steps:
> 
> 01. $ cd ~
> 02. $ wget -c
> http://users.telenet.be/Jan.Van.hijfte/qtforfpc/bin-qt4pas-V2.1_Qt4.5.3.ta
> r.gz 03. $ tar -zxvf bin-qt4pas-V2.1_Qt4.5.3.tar.gz
> 04. $ cd bin-qt4pas-V2.1_Qt4.5.3/
> 05. $ su <your password>
> 06. # mv libQt4Pas* /usr/local/lib/
> 07. # ldconfig
> 08. # ldconfig -p | grep  libQt4Pas* (show if .so is installed)
> 09. # exit
> 09. $ mv qt4.pas /usr/lib/lazarus/lcl/interfaces/qt/
> 12. $ cd ~
> 13. $ rm -rf .lazarus
> 14. Now compile the LCL for Qt.
>       First open your normal gtk2 compiled Lazarus.
>       Then go on the menu "Tools" --> "Configure Build Lazarus".
>       Set LCL to "clean+build" and everything else to "None".
>       Now select "Qt" and click on the "Ok" button.
>       Next go to the menu "Tools" --> "Build Lazarus".
>       Now the LCL is compiled for Qt.
>       To compile a project for Qt just select it as the target
> widgetset on the Compiler Options dialog.
> 
> And start your Lazarus.
> 
> See: http://wiki.lazarus.freepascal.org/index.php/Qt_Interface

There's extra unneeded steps in your installation.
libQt4Pas is only important part and nothing else. There are 2 versions of it, 
one normal, and one compiled with -mstackrealign to avoid crashes with >= 
Qt-4.7 since it uses sse2 instructions by default (so if you use 1st one 
you'll get immediate crash with TCustomControls while painting).
So, let's assume that you have lazarus trunk and you use gtk2 ...
1.Download libQt4Pas (eg. binary as you mentioned).
2.Copy it to /usr/lib (or /usr/lib64 if you use 64 bit version, but in that 
case you have to download binary 64bit version ).Also you have to be root to 
do this operation (or use su or use sudo).
Then:
ln -s /usr/lib/libQt4Pas.so.5.2.1 /usr/lib/libQt4Pas.so.5.2
ln -s /usr/lib/libQt4Pas.so.5.2.1 /usr/lib/libQt4Pas.so.5
ln -s /usr/lib/libQt4Pas.so.5.2.1 /usr/lib/libQt4Pas.so

And that's all.
Now go to lazarus trunk dir.
make bigideclean
make bigide LCL_PLATFORM=qt
./startlazarus 
voila !

Other case is when you want to use gtk2 ide ... then just set macro 
LCLWidgetSet in your project options to qt and rebuild your project against 
qt.

zeljko



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111016/829e2acd/attachment-0003.html>


More information about the Lazarus mailing list