Hi,
What the steps to build my Lazarus to use Qt?
My environment:
OpenSUSE 11.4 with KDE.
Thx.

Mailing lists / lazarus / 2011-10
8 messages · 2 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hi,
What the steps to build my Lazarus to use Qt?
My environment:
OpenSUSE 11.4 with KDE.
Thx.
Sorry, the error is:
# cd /usr/lib/lazarus
# make PREFIX=/usr clean all LCL_PLATFORM=qt OPT="-dUSE_QT_45"
...
Compiling projectwizarddlg.pas
Compiling idecmdline.pas
Compiling resource ../units/i386-linux/lazarus.or
Linking ../lazarus
/usr/bin/ld: warning: ../link.res contains output sections; did you forget -T? /usr/bin/ld: cannot find -lQt4Pas
lazarus.pp(130,1) Error: Error while linking
lazarus.pp(130,1) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted
make[2]: *** [lazarus] Error 1
make[2]: Leaving directory `/usr/lib/lazarus/ide'
make[1]: *** [ide] Error 2
make[1]: Leaving directory `/usr/lib/lazarus/ide'
make: *** [ide] Error 2
2011/10/15 silvioprog :
I solved my problem.
Steps to install:
1. Download http://users.telenet.be/Jan.Van.hijfte/qtforfpc/V2.4/bin-qt4pas-V2.4_Qt4.5.3.tar.gz
2. Unzipp and move all .so to /usr/lib
3. make PREFIX=/usr clean all LCL_PLATFORM=qt OPT="-dUSE_QT_45"
Done!
Thx.
2011/10/15 silvioprog :
[...]
4. move "qt4.pas" file to /usr/lib/lazarus/lcl/
2011/10/15 silvioprog : I solved my problem. Steps to install: 1. Download…
More error. After build, my IDE crash on starts:
./startlazarus
TLazarusManager.Run DefaultDir="/usr/lib/lazarus/" CustomDir="/home/silvioprog/.lazarus/bin/"
TLazarusManager.Run starting /usr/lib/lazarus/lazarus ... TMainIDE.ParseCmdLineOptions:
PrimaryConfigPath="/home/silvioprog/.lazarus"
SecondaryConfigPath="/etc/lazarus"
NOTE: miscellaneous options file not found - using defaults NOTE: codetools config file not found - using defaults
NOTE: Lazarus source directory not set! (see Environment / Options ... / Environment / Files)
TFPCTargetConfigCache.NeedsUpdate compiler file changed "/usr/bin/fpc" FileAge=1317210277 StoredAge=0
TFPCTargetConfigCache.Update /usr/bin/fpc TargetOS=linux TargetCPU=i386 CompilerOptions= ExtraOptions=
PATH=/home/silvioprog/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin RunTool /usr/bin/fpc -iTOTP -Pi386 -Tlinux
RunTool /usr/bin/fpc -va -Pi386 -Tlinux compilertest.pas TFPCTargetConfigCache.Update: has changed
NOTE: help options config file not found - using defaults TMainIDE.DoNewProject A
TFPCSourceCache.Update /usr/share/fpcsrc has changed. QPainter::end: Painter ended with 4 saved states
TApplication.HandleException Access violation
Stack trace:
$B5A71FF4
QWidget::repaint: Recursive repaint detected
QPainter::end: Painter ended with 4 saved states
TApplication.HandleException: there was another exception during showing the first exception
Stack trace:
$B5A71FF4
[TMainIDE.Destroy] A
[TMainIDE.Destroy] B -> inherited Destroy... TMainIDE [TMainIDE.Destroy] END
What the steps to build my Lazarus to use Qt? My environment: OpenSUSE 11.4 with KDE. Thx.
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.tar.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
My first project compiled in Qt, and lclwebkit:
Finally, I managed to compile Lazarus to Qt. All steps: 01. $ cd ~ 02. $ wget -c…
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.freepascal.org/pipermail/lazarus/attachments/20111016/829e2acd/attachment-0001.html>