Recent

Author Topic: Trying to compile to Qt, Linux  (Read 12848 times)

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« on: October 20, 2007, 05:50:13 am »
Hi
I have the latest snapshot in use.
And I have downloaded the Qt binary .so file and put that in the /usr/lib/ folder
but when I set to build the LCL , I get an error, about i386-linux/qt

what should I have set for the options?

what am I missing?

also, is it possible to use the carbon widget set on linux (which I have in use on my mac, looks much better than gtk! :)
( i get a similar error when trying to compile to carbon under linux)
as I really dont want to have to purchase QT, too much $

thanks!
Brian

update: made some progress by running lazarus with xwindows running as root
so now the directories could be created
now, for compiling the LCL as carbon, i get error about cant find unit FPCMacOSAll used by Carbonint
I can now compile the LCL for Qt
but when I try to set the compiler to Qt, I get error about linking (and lots of errors referencing QT with the qt4 .so file

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Trying to compile to Qt, Linux
« Reply #1 on: October 20, 2007, 11:48:41 am »
make sure you got also the libqt4intf.so file and put it in your library path (eg: /usr/local/lib) AND did a "ldconfig" afterwards too.

windy

  • Full Member
  • ***
  • Posts: 186
RE: Trying to compile to Qt, Linux
« Reply #2 on: October 20, 2007, 01:11:50 pm »
Hi
ok, i copied to /usr/local/lib too and did a ldconfig as well

I still see undefined reference messages
(e.g QTransform::translate(double,double)
and then at the end of that string of messages, error while linking....
so close but no cigar as they say!

maybe I downloaded the wrong .so file?
i downloaded the x11 one...thats for linux, yes?

windy

  • Full Member
  • ***
  • Posts: 186
RE: Trying to compile to Qt, Linux
« Reply #3 on: October 20, 2007, 01:51:32 pm »
humm, i got it to compile by putting in
-framework /usr/local/lib/libqt4intf.so -shared  and tick pass options to the linker
but when I run a simple program that has been compiled i get a segmentation fault....
do i need to create an application bundle for it?

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
RE: Trying to compile to Qt, Linux
« Reply #4 on: October 20, 2007, 02:22:56 pm »
ok, you did something wrong, so I'll elaborate a bit here.
1.What qt version you have installed on your linux machine ?
I'll assume that's 4.3.XX
so libQtXXX should be in /usr/lib
2.Download bindings from http://users.pandora.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html
BE CAREFUL THERE'S FEW VERSIONS !
If U have Qt-4.3.XXX then download 4.3.1 -> X11 (V1.53) -> bin-qt43 XXXXX.tar.gz
unpack it and copy libqt4intf.so into /usr/lib
3.Download latest svn or daily snapshot.

4.Now you can compile it and use it.

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: RE: Trying to compile to Qt, Linux
« Reply #5 on: October 20, 2007, 02:25:40 pm »
Quote from: "windy"
humm, i got it to compile by putting in
-framework /usr/local/lib/libqt4intf.so -shared  and tick pass options to the linker
but when I run a simple program that has been compiled i get a segmentation fault....
do i need to create an application bundle for it?


No, -framework & bundles are just if U need qt on macosx.
go here and look for Mac hints if U need it, but also other things about qt interface.

http://wiki.lazarus.freepascal.org/index.php/Qt_Interface

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #6 on: October 20, 2007, 08:28:41 pm »
Hi
thanks for the help so far :)
I have done all of the above, and read that page lots of time
what about geting carbon to work on linux and the missing FPCMacOSAll?
:)

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Trying to compile to Qt, Linux
« Reply #7 on: October 20, 2007, 09:32:32 pm »
Ok, send some compiling errors here. I've got "the case" two days ago (also problem with compiling qt interface), he told me that he have latest bindings etc ... but the point was that in /usr/lib was libqt4intf.so smaller for about 100k then current release , so I think that he's got 1.50.
Old bindings causes problems !
Latest qt43.pas & latest bindings guarantee success.

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #8 on: October 20, 2007, 09:59:27 pm »
the file details are:
1,7mb for the .so file, 10/06/07 06:08am and same date for the .pas file (923.0kb)
do I have the latest update?

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #9 on: October 20, 2007, 10:15:03 pm »
i have done a search of the files
the ones in the lazarus directory, in the qt folder, are older!
standby!

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #10 on: October 20, 2007, 10:22:33 pm »
dang!
and I thought that was the solution!
i recompiled the LCL with that new libqt4.pas in the usr/lib/lazarus/lcl/interaces/qt
which was OK, and then tried to compile a simple program set to qt widget, but still the same errrs about
/usr/local/lib/libqt4int.so:undefined reference to: Q  etc
and then finally
project1.lpr(17,1) Error: Error while linking
(which was fatal)

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #11 on: October 20, 2007, 10:44:55 pm »
if I do a test under the compiler options, I get all tests succeeded...

maybe I dont have the latest snaphot?
it notice its still 2.2 and not 2.2.1 for the FPC?
I did download it on the 20th Oct from the daily snapshots web site, for linux i-386...
(and that is confirmed under help, about, 0.23 beta, 20/10/2007, svn revision)

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #12 on: October 21, 2007, 05:23:15 am »
good
I used the FPCMacOSAll.pas file from the windows version of Lazarus
and so its not complaining about missing that file...
but that file must be a bit older, still an error....so I will look to download the latest windows version of lazarus

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #13 on: October 21, 2007, 06:14:36 am »
hummm
now I get an error with incompatible type for arg  in th ecarbonlists.pp file
maybe I should try a new lazarus snap shot download for linux?

windy

  • Full Member
  • ***
  • Posts: 186
Trying to compile to Qt, Linux
« Reply #14 on: October 21, 2007, 07:43:05 am »
i seem to have stuffed things up...I cant even compile to the default gtk now....cannot find /usr/lib/libpthread_nonshared.a

is it possible to compile to linux from my mac intel pc lazarus version, and if so, how?
thanks!
(as setting the target os to linux and the target cpu to i386 i get an error, the system.ppu was not found in the FPC directories, etc
or maybe I compile from windows to linux (I see there is a help on that in the wiki), as the windows version can be set to use qt OK (but wait, missing qt4 dll file)
i see this info for compiling to linux from windows:
http://www.stack.nl/~marcov/crossnotes.txt
too difficult, instead I will try to get lazarus sorted out (even a re install of linux)

 

TinyPortal © 2005-2018