* * *

Author Topic: Qt4Pas for ARM  (Read 4364 times)

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Qt4Pas for ARM
« on: November 20, 2012, 12:59:13 pm »
According to http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM
I successfully built GTK aplication for my ARM board. Target files
needed for linking process, I copied from my board, ie. from Buildroot
built root file system.
I also successfully compiled 386 Qt project, using Qt4Pas from http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html.
Now I tried building same Qt project for ARM (target libraries included
the same way as above). However I received link error -cannot find -lQt4Pas.
So my question is how can I provide ARM built libQt4Pas.so file or better
- how can I crosscompile it by myself ? In that case what/where are the
sources for that libarary ?

Regards

Blaazen

  • Hero Member
  • *****
  • Posts: 1623
Re: Qt4Pas for ARM
« Reply #1 on: November 20, 2012, 01:15:37 pm »
On Linux, I have libQt4pas.so.5.2.5 in /usr/lib as well as symlinks libQt4pas.so, libQt4pas.so.5 and libQt4pas.so.5.2 to this library.
After installing this file and these 3 symlinks you should run ldconfig. IIRC thats all.
Lazarus 1.3 r44722M FPC 2.7.1 r27408 x86_64-linux-qt Chakra 2013.5, Qt 4.8.5, KDE4.12.2
Lazarus 1.2.0 r44303 FPC 2.6.4 i386-win32-win32/win64 Wine 1.7.16

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #2 on: November 20, 2012, 01:47:39 pm »
I have all that files, also, but I wonder if they will do the job, because binary code inside that .so file is of 386 (or compatible) type (so it works on desktop). There are no ARM machine instructions (by my opionion) inside them. However I could try.

Blaazen

  • Hero Member
  • *****
  • Posts: 1623
Re: Qt4Pas for ARM
« Reply #3 on: November 20, 2012, 02:06:38 pm »
Then you should compile yourself. There are some instructions for embedded on the wiki: http://wiki.freepascal.org/Qt4_binding
Lazarus 1.3 r44722M FPC 2.7.1 r27408 x86_64-linux-qt Chakra 2013.5, Qt 4.8.5, KDE4.12.2
Lazarus 1.2.0 r44303 FPC 2.6.4 i386-win32-win32/win64 Wine 1.7.16

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #4 on: November 21, 2012, 02:32:45 pm »
Downloaded sources from http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
and do qmake in folder where are Qt4Pas.pro, which generated makefile. After that command make gave too many errors. For example first one:
class QWidget has no member named accessibleName
and many more.
Probably someone already passed the way I do now, so hope for help.

DenJean

  • New member
  • *
  • Posts: 17
Re: Qt4Pas for ARM
« Reply #5 on: November 21, 2012, 11:46:51 pm »
It is possible, I did it for BeagleBone. Just follow instructions for your board on how to cross compile c++ code. Native arm compiling is easier, just takes longer. Make sure you have enough memory (add swap space if necessary).

You can use a more recent binding version, the one I used for Beaglebone:
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/V2.6RC2/

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #6 on: November 22, 2012, 12:03:51 pm »
I managed to compile libQt4Pas.so for my ARM board and when I compile Qt Lazarus project (form only - no code) then I get few errors, all starting with:
undefined reference to QX11Info_....
Maybe I had to compile Qt with QTOPIA option. I tried to add in Project Options menu, under the "Compiler Options/Other" flag -dQTOPIA, but it didn't change anything.
Qt Lazarus project for 386 compiles and runs OK.
Any help ?

Regards

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #7 on: November 22, 2012, 12:33:10 pm »
Maybe I'm wrong, but it seems to me like I didn't inform Lazarus not to compile Qt "over" X11, ie. that my intention is tu use framebuffer on my embedded device.

DenJean

  • New member
  • *
  • Posts: 17
Re: Qt4Pas for ARM
« Reply #8 on: November 22, 2012, 04:17:15 pm »
Qtopia is pretty old as most embedded now have X11. I have not recently tried to compile a Lazarus for QTOPIA.

To compile the binding, edit the Qt4Pas.pro and just ensure that PLATFORM is set to QTOPIA. This will cause a define QTOPIA to exist when compiling the c++ binding code.

When compiling lazarus, make sure you add a define QTOPIA aswell, so that in qt4.pas the corresponding functions are defined.

I do not know the state of lazarus lcl with regards to QTOPIA. Maybe you should ask on http://lists.lazarus.freepascal.org/pipermail/qt/, zeljko reads that and maybe he knows the answer.


djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #9 on: November 22, 2012, 07:15:03 pm »
What makes me try Qt without X11 are few examples built while building Linux on my ARM board. I noticed there, that when starting executables with -qws option, it starts prety fast (oposed to X11 which requires 10 seconds to start).
So my intetnion was to use Lazarus (if possible at all) to crosscompile Qt programs that wouldn't use X11 - ie which would be started with -qws (Qt windowing system) option. I have success with GTK+X11 with Lazarus on ARM, but it is too slow.
Compiling libqt4pas for ARM passed OK, but when compiling project I get errors previously described (QX11Info...).

zeljko

  • Sr. Member
  • ****
  • Posts: 483
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Qt4Pas for ARM
« Reply #10 on: November 23, 2012, 08:24:57 am »
djdjdjole, try to add $DEFINE QTOPIA into qtdefines.inc. It should not scream about QX11Info since it's ifdeffed by BINUX which isn't defined when QTOPIA is defined.

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #11 on: November 23, 2012, 11:17:42 am »
Added {$DEFINE QTOPIA} at the end of qtdefines.inc. Error still persists. It does look incredable because of ifdefs you mentioned in qt4.pas.
This is build output:

Options changed, recompiling clean with -B
Hint: Start of reading config file /home/djdjdjole/.fpc.cfg
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/djdjdjole/.fpc.cfg
Free Pascal Compiler version 2.6.0 [2012/08/30] for arm
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Linux for ARMEL
Compiling project1.lpr
Compiling unit1.pas
Assembling unit1
Assembling project1
Compiling resource /home/djdjdjole/Projekti/386/qtpro/lib/arm-linux/project1.or
Linking project1
/home/djdjdjole/lazarus/lcl/units/arm-linux/qt/qtint.o: In function `TQTWIDGETSET__TEXTUTF8OUT':
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:885: undefined reference to `QX11Info_isCompositingManagerRunning'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:886: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
project1.lpr(22) Error: Error while linking
/home/djdjdjole/lazarus/lcl/units/arm-linux/qt/qtint.o: In function `TQTWIDGETSET__TEXTUTF8OUT':
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:885: undefined reference to `QX11Info_isCompositingManagerRunning'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:886: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_display'
/home/djdjdjole/lazarus/lcl/interfaces/./qt/qtlclintf.inc:883: undefined reference to `QX11Info_appScreen'
project1.lpr(22) Error: Error while linking
project1.lpr(22) Fatal: There were 1 errors compiling module, stopping

Here is my options, taken from IDE:

 -MObjFPC -Scghi -O1 -Tlinux -Parm -g -gl -vewnhi -l -Filib/arm-linux -Fu../../../lazarus/lcl/units/arm-linux/qt -Fu../../../lazarus/lcl/units/arm-linux -Fu../../../lazarus/components/lazutils/lib/arm-linux -Fu../../../lazarus/packager/units/arm-linux -Fu. -FUlib/arm-linux/ -dLCL -dLCLqt -dQTOPIA -k-L/home/djdjdjole/lazarus/fpc/libcross

Thanks

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #12 on: November 23, 2012, 11:34:30 am »
Oh, stupid me  >:(. I should put {$DEFINE QTOPIA} at beginning of qtdefines.inc. Now it compiles - I should check if it works on target and to inform those interested in this matter.
Still don't know why it was not defined through option !!!

Thanks
 

djdjdjole

  • Jr. Member
  • **
  • Posts: 74
Re: Qt4Pas for ARM
« Reply #13 on: November 23, 2012, 12:32:11 pm »
On target - "error while loading shared libraries: libQt4Pas.so.5: cannot open shared object file: No such file or directory
File exists on /usr/bin (which is on PATH).
Probably I made a mistake compiling library.

Regards

DenJean

  • New member
  • *
  • Posts: 17
Re: Qt4Pas for ARM
« Reply #14 on: November 23, 2012, 03:19:17 pm »
libs should not be in bin, PATH is for executables, LD_LIBRARY_PATH is for libraries.
just put it next to the libraries of Qt.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads