Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2008-12

Linking error with Lazarus Qt on Mac OS X 10.5

9 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Stephane Carre

Hi,
I hope this is the proper list for this, so please accept my apologies if I'm posting to the wrong place...

I have Lazarus (Carbon, latest snapshot) installed on Mac OS X 10.5, and managed to successfully recompile the LCL for Qt.
So far, so good.
Now, if I try to create an application (a simple form with a button on it) with Qt as the target, it compiles fine, but gives the following linking error:

Undefined symbols:
"_QFileDialog_filters", referenced from:
_QTWIDGETS_TQTFILEDIALOG_$__GETFILTERS$QSTRINGLISTH in qtwidgets.o ld: symbol(s) not found
An error occurred while linking
Error: Error while linking

I checked the version of qt44.pas, it is v1.68. I'm not sure where I should find the conditional define USE_QT_44 that makes qt.pas point to qt44.pas, but since the LCL compiled just fine, I asssume it must be set correctly.

Can anyone suggest further actions?

Den Jean
to Stephane Carre
Stephane Carre wrote
I have Lazarus (Carbon, latest snapshot) installed on Mac OS X 10.5, and managed to successfully recompile the LCL for Qt.

Which Qt?
--------------
Which Qt do you have installed ? Qt4.4.X or Qt4.3.X ? When in doubt, remove Qt and install latest Qt 4.4.X

Corresponding Interface Binary:
------------------------------------------
The pascal to Qt interface (/Frameworks/Qt4Intf.framework/Qt4Intf) can be downloaded from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html For Qt 4.4.X there is a binary available, for Qt 4.3.X you need to compile the interface library yourself. Download the source and follow the instructions. If these are not clear or incorrect, please report and it will be improved.

Compiling Lazarus:
-------------------------
see http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html Qt 4.4.X : with -dUSE_QT_44
make clean all LCL_PLATFORM=qt OPT="-dUSE_QT_44 -k'-framework' -k'Qt4Intf' - k'-lobjc' -k'-framework' -k'Foundation'"

Qt 4.3: without -dUSE_QT_44
make clean all LCL_PLATFORM=qt OPT="-k'-framework' -k'Qt4Intf' -k'-lobjc' -k'- framework' -k'Foundation'"

compile applications: You need set the same "linker" options passed in the previous commandlines in the lazarus compile options dialogs.

Lazarus -> Project -> Compiler Options -> Linking page -> Options (-k): -framework Qt4Intf -lobjc -framework Foundation

Show quoted text 6 lines
Undefined symbols: "_QFileDialog_filters", referenced from: _QTWIDGETS_TQTFILEDIALOG_$__GETFILTERS$QSTRINGLISTH in qtwidgets.o ld: symbol(s) not found An error occurred while linking Error: Error while linking

Means you compiled lazarus without define USE_QT_44 and that the symbol (in this case the procedure QFileDialog_filters) was not resolved (not found in any libraries on your system)

Please read
http://wiki.lazarus.freepascal.org/Qt_Interface_Mac and report or fix mistakes.

kind regards,

Den Jean

Stephane Carre

Small update on point 4 below:

Show quoted text 5 lines
4) I stopped investigating with the latest snapshot and had to go back to the latest stable release (0.9.26), because, other than Qt issues, the package installation mechanism is broken, so I could not install SqlDB, LazReport and other packages which are required for my applications.

I tried again this morning with the snapshot from 26 dec 2008 (the snapshot from 27 dec 2007 crashes upon opening my project). I recompiled the LCL via the menu Tools/Configure "Build Lazarus", selecting the 'Clean all' and 'With packages' options. I passed "-dUSE_QT_44 -k'-framework' -k'Qt4Inft' -k'-lobjc' -k'-framework' -k'Foundation'" in the Options edit box.
Now simple projects no longer have a linking error... but since package installation is still VERY broken with the snapshots, the whole thing is useless for my projects requiring DB access and reporting.

How can I get Qt to work with the stable version of Lazarus (0.9.26) ?

Den Jean
to Stephane Carre
Stephane Carre wrote
How can I get Qt to work with the stable version of Lazarus (0.9.26) ?

Lazarus 0.9.26 LCL/Qt uses freepascal qt interface V1.62. Install that one, I added this old version to the
webpage, including instructions.

Do not forget to install Qt 4.3.4 ofcourse (link included).

regards,

Den Jean

Vincent Snijders
to Stephane Carre
Stephane Carre wrote
Yes, I did report this as issue 12864.

But you did not add the requested extra information from the console. This issue is waiting for your feedback.

Vincent