Sign in Join

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

Mailing lists / qt / 2011-12

Link failure (undefined reference to `QFileDialog_selectFilter')

12 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Laird

Hi,

Before asking for your help, I want to say to the author(s) of this Qt interface for Lazarus: thank you for your time and effort, it's really great to be able to compile Lazarus projects with a Qt widgetset.

Unfortunately, though, I can't quite compile them yet: after following all the steps at
<http://wiki.lazarus.freepascal.org/Qt_Interface#Quick_start_guide_for_Linux>, I'm still having problems - the linker complains about undefined references. Here is the full set of error messages for the compilation of a completely new project:

Show quoted text 7 lines
/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/share/lazarus/lcl/units/i386-linux/qt/qtwidgets.o: In function `TQTFILEDIALOG__SETSELECTEDFILTER': /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas:9702: undefined reference to `QFileDialog_selectFilter' /usr/share/lazarus/lcl/units/i386-linux/qt/qtwidgets.o: In function `TQTFILEDIALOG__GETFILTERS': /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas:9747: undefined reference to `QFileDialog_filters' project1.lpr(20,1) Error: Error while linking project1.lpr(20,1) Fatal: There were 1 errors compiling module, stopping

Any ideas on how to solve this problem?

In case it helps, I'm running Lazarus 0.9.30 on Gentoo Linux with Qt version 4.7.2 and Qt4Pas version 2.4; I've compiled Qt4Pas from scratch but the same problem occurred when I installed the pre-compiled binaries. I've also created a symbolic link from libqt4intf.so to libQt4Pas.so as the linker had been complaining that it couldn't find -lqt4intf.

Cheers,
Laird

zeljko
to Laird
Laird wrote 11 lines
Hi, Before asking for your help, I want to say to the author(s) of this Qt interface for Lazarus: thank you for your time and effort, it's really great to be able to compile Lazarus projects with a Qt widgetset. Unfortunately, though, I can't quite compile them yet: after following all the steps at <http://wiki.lazarus.freepascal.org/Qt_Interface#Quick_start_guide_for_Linu x>, I'm still having problems - the linker complains about undefined references. Here is the full set of error messages for the compilation

That guide can be out of date (cannot acess lazarus wiki atm). Seem that you mismatched things.

Any ideas on how to solve this problem? In case it helps, I'm running Lazarus 0.9.30 on Gentoo Linux with Qt version 4.7.2 and Qt4Pas version 2.4; I've compiled Qt4Pas from scratch

That's good.
in terminal
make bigideclean LCL_PLATFORM=qt
make bigide LCL_PLATFORM=qt
and it should work (DO NOT ADD USE_QT_45 DEFINE or similar those are not needed), also lazarus trunk is much better then 0.9.30 (a lot of things is fixed, and MDI support is added).

but the same problem occurred when I installed the pre-compiled binaries. I've also created a symbolic link from libqt4intf.so to libQt4Pas.so as the linker had been complaining that it couldn't find -lqt4intf.

qt4intf isn't used anymore, only libQt4Pas.
ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5.2
ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5
ln -s libQt4Pas.so.5.2.1 libQt4Pas.so

and it should work.

zeljko
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20111220/1c4a41e6/attachment.html>

Laird
to zeljko

Thanks for the help, zeljko.

Show quoted text 8 lines
in terminal make bigideclean LCL_PLATFORM=qt make bigide LCL_PLATFORM=qt and it should work (DO NOT ADD USE_QT_45 DEFINE or similar those are not needed), also lazarus trunk is much better then 0.9.30 (a lot of things is fixed, and MDI support is added).

I did that, and when I restarted Lazarus the IDE was Qt instead of GTK, however I still couldn't compile a new project with a Qt interface - I still got the same linker errors. Any other ideas?

Show quoted text 6 lines
qt4intf isn't used anymore, only libQt4Pas. ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5.2 ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5 ln -s libQt4Pas.so.5.2.1 libQt4Pas.so and it should work.

Unfortunately, it doesn't. I have those symlinks (except that I have 5.2.4 instead of 5.2.1) but it doesn't work when I delete the additional symlink that I created, libqt4intf.so. Then I get the following errors:

/usr/bin/ld: warning: link.res contains output sections; did you forget -T? /usr/bin/ld: cannot find -lqt4intf project1.lpr(19,1) Error: Error while linking project1.lpr(19,1) Fatal: There were 1 errors compiling module, stopping

Cheers,
Laird

zeljko
to Laird
Laird wrote 14 lines
Thanks for the help, zeljko. > in terminal > > make bigideclean LCL_PLATFORM=qt > make bigide LCL_PLATFORM=qt > > and it should work (DO NOT ADD USE_QT_45 DEFINE or similar those are not > needed), also lazarus trunk is much better then 0.9.30 (a lot of things > is fixed, and MDI support is added). I did that, and when I restarted Lazarus the IDE was Qt instead of GTK, however I still couldn't compile a new project with a Qt interface - I still got the same linker errors. Any other ideas?

hmm...that's pretty strange, can you try to create new empty project with simple form and build ?

Show quoted text 24 lines
> qt4intf isn't used anymore, only libQt4Pas. > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5.2 > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5 > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so > > and it should work. Unfortunately, it doesn't. I have those symlinks (except that I have 5.2.4 instead of 5.2.1) but it doesn't work when I delete the additional symlink that I created, libqt4intf.so. Then I get the following errors: > /usr/bin/ld: warning: link.res contains output sections; did you forget > -T? /usr/bin/ld: cannot find -lqt4intf > project1.lpr(19,1) Error: Error while linking > project1.lpr(19,1) Fatal: There were 1 errors compiling module, stopping Cheers, Laird _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20111220/4d063235/attachment.html>

zeljko
to Laird: Thanks for the help, zeljko. I did that, and when I restarted Lazarus the IDE was Qt…
Laird wrote 14 lines
Thanks for the help, zeljko. > in terminal > > make bigideclean LCL_PLATFORM=qt > make bigide LCL_PLATFORM=qt > > and it should work (DO NOT ADD USE_QT_45 DEFINE or similar those are not > needed), also lazarus trunk is much better then 0.9.30 (a lot of things > is fixed, and MDI support is added). I did that, and when I restarted Lazarus the IDE was Qt instead of GTK, however I still couldn't compile a new project with a Qt interface - I still got the same linker errors. Any other ideas?

hm, just tried an old fixes_0930 branch and it works. 1.Tools->Configure "Build lazarus". Is there qt widgetset ? 2.Project->Compiler options->Path->Widgetset type ? is it qt ?

Try to rebuild lazarus from ide with Clean+Build ...

Show quoted text 24 lines
> qt4intf isn't used anymore, only libQt4Pas. > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5.2 > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so.5 > ln -s libQt4Pas.so.5.2.1 libQt4Pas.so > > and it should work. Unfortunately, it doesn't. I have those symlinks (except that I have 5.2.4 instead of 5.2.1) but it doesn't work when I delete the additional symlink that I created, libqt4intf.so. Then I get the following errors: > /usr/bin/ld: warning: link.res contains output sections; did you forget > -T? /usr/bin/ld: cannot find -lqt4intf > project1.lpr(19,1) Error: Error while linking > project1.lpr(19,1) Fatal: There were 1 errors compiling module, stopping Cheers, Laird _______________________________________________ Qt mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20111220/f607ccbd/attachment.html>

Laird
to zeljko
zeljko wrote
1.Tools->Configure "Build lazarus". Is there qt widgetset ?

Yes.

2.Project->Compiler options->Path->Widgetset type ? is it qt ?

Yes.

Try to rebuild lazarus from ide with Clean+Build ...

I tried and it errored out with the same error whilst trying to build the examples:

Show quoted text 44 lines
/usr/share/lazarus/lcl/interfaces/qt/qt43.pas(797,25) Note: Values in enumeration types have to be ascending /usr/share/lazarus/lcl/interfaces/qt/qt43.pas(9850,37) Note: Values in enumeration types have to be ascending /usr/share/lazarus/lcl/interfaces/qt/qt43.pas(10738,32) Note: Values in enumeration types have to be ascending /usr/share/lazarus/lcl/interfaces/qt/qtobjects.pas(700,4) Note: User defined: TODO: make TQTImage a TQtResource /usr/share/lazarus/lcl/interfaces/qt/qtobjects.pas(2650,6) Note: User defined: workaround - possible qt4 bug with QPainter & RGB32 images. /usr/share/lazarus/lcl/interfaces/qt/qtcaret.pas(384,4) Note: User defined: TEmulatedCaret.Lock() remove this routine later, after testing on all platforms /usr/share/lazarus/lcl/interfaces/qt/qtcaret.pas(392,4) Note: User defined: TEmulatedCaret.UnLock() remove this routine later, after testing on all platforms /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(2133,4) Note: User defined: this is workaround for Qt bug which reports wrong keys with Shift+Ctrl pressed. Fixes #13450. LAST REVISION: Qt-4.5.2 git snapshot 20090607. zeljko /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(2831,4) Note: User defined: Check this with next qt version (>4.3.4) /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(4090,6) Note: User defined: there's a bug with QFontMetrics_width() & QFontMetrics_height() on MacOSX (qt-4.3,qt-4.4) so we must increase PrefW & PrefH for some reasonable value. /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(5518,4) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(5564,4) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(5574,4) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(5806,6) Note: User defined: we can remove QLCLTabWidget, and get it like StackWidget, objectName is qt_tabwidget_tabbar. /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(7484,4) Note: User defined: QSizeH implementation missing for this /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(7490,4) Note: User defined: QSizeH implementation missing for this /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(7511,4) Note: User defined: QSizeH implementation missing for this /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(7517,4) Note: User defined: QSizeH implementation missing for this /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas(9369,6) Note: User defined: this call avoid sporadic AVs with QLCLItemDelegate_destroy(FNewDelegate). /usr/share/lazarus/lcl/interfaces/qt/qtwscomctrls.pp(781,4) Note: User defined: review - must add item into header before adding image ... /usr/share/lazarus/lcl/interfaces/qt/qtwscomctrls.pp(851,4) Note: User defined: FIXME workaround issue #9746 /usr/share/lazarus/lcl/interfaces/qt/qtwscomctrls.pp(1238,6) Note: User defined: for proper implementation of all TSortType we have to implement item sorting roles. if QtTreeWidget.Header.sortIndicatorOrder = QtDescendingOrder then QtTreeWidget.sortItems(AColumn, QtAscendingOrder) else QtTreeWidget.sortItems(AColum /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(341,3) Note: Local variable "selectedFilter" not used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(342,3) Note: Local variable "saveFileName" is assigned but never used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(342,17) Note: Local variable "saveTitle" is assigned but never used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(342,28) Note: Local variable "saveFilter" not used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(347,3) Note: Local variable "Flags" not used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(532,15) Note: Local variable "saveFileName" is assigned but never used /usr/share/lazarus/lcl/interfaces/qt/qtwsdialogs.pp(532,29) Note: Local variable "saveTitle" is assigned but never used /usr/share/lazarus/lcl/interfaces/qt/qtwsstdctrls.pp(504,4) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwsstdctrls.pp(1242,4) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwinapi.inc(1447,5) Note: User defined: implement /usr/share/lazarus/lcl/interfaces/qt/qtwinapi.inc(4161,3) Note: Local variable "EmptyRegion" not used "LCL" completed "Package Registration" completed "IDE Interface" completed "SynEdit" completed /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/share/lazarus/lcl/units/i386-linux/qt/qtwidgets.o: In function `TQTFILEDIALOG__SETSELECTEDFILTER': /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas:9702: undefined reference to `QFileDialog_selectFilter' /usr/share/lazarus/lcl/units/i386-linux/qt/qtwidgets.o: In function `TQTFILEDIALOG__GETFILTERS': /usr/share/lazarus/lcl/interfaces/qt/qtwidgets.pas:9747: undefined reference to `QFileDialog_filters' /usr/share/lazarus/examples/hello.pp(31,1) Error: Error while linking /usr/share/lazarus/examples/hello.pp(31,1) Fatal: There were 1 errors compiling module, stopping

Laird

Den Jean
to Laird
Laird wrote
> /usr/share/lazarus/lcl/interfaces/qt/qt43.pas(10738,32) Note: Values in > enumeration types have to be ascending

You are using very old lazarus code. *qt43.pas* means Qt 4.3 ?!

Please use a fresh svn checkout of lazarus.
Output of svn diff should be empty.
Output svn info should be around Rev 34335.

Use the latest stable fpc. Output fpc -iW should be 2.4.4

Use the latest binding.
Please start fresh. Remove all libqtintf* and libQt4Pas* from /usr/lib/ or /usr/local/lib/ and compile and install a fresh binding. And for the moment use the plastique kde widget style.

regards,

Den Jean

zeljko
to Laird: Yes. Yes. I tried and it errored out with the same error whilst trying to build the…
Laird wrote 16 lines
On 21/12/11 06:05, zeljko wrote: > 1.Tools->Configure "Build lazarus". Is there qt widgetset ? Yes. > 2.Project->Compiler options->Path->Widgetset type ? is it qt ? Yes. > Try to rebuild lazarus from ide with Clean+Build ... I tried and it errored out with the same error whilst trying to build the examples: > /usr/share/lazarus/lcl/interfaces/qt/qt43.pas(797,25) Note: Values in > enumeration types have to be ascending

qt43.pas DOES NOT EXIST in lazarus 0.9.30 - SOMETHING is wrong with your installation.
Look files in qt lcl from 0.9.30
http://svn.freepascal.org/cgi-
bin/viewvc.cgi/tags/lazarus_0_9_30/lcl/interfaces/qt/?root=lazarus

So all of your problem comes from installation. Perhaps you installed 0.9.30 over older one (0.9.28) or it isn't

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20111221/7c6043e5/attachment.html>

Laird
to Den Jean: You are using very old lazarus code. *qt43.pas* means Qt 4.3 ?! Please use a fresh svn…
Den Jean wrote 5 lines
On Wednesday 21 December 2011 02:43:38 Laird wrote: >> /usr/share/lazarus/lcl/interfaces/qt/qt43.pas(10738,32) Note: Values in >> enumeration types have to be ascending You are using very old lazarus code. *qt43.pas* means Qt 4.3 ?!

Thank you, Den. That clued me in to the problem. The version of Lazarus that I use, 0.9.30, is installed in /usr/local/lazarus, but I also have installed through my package manager (Portage) the most recent version of Lazarus that it has available, 0.9.28.2-r1, and that installation's directory is /usr/share/lazarus.

The problem was that the 0.9.30 version had its
Environment->Options->Environment->Files->"Lazarus directory (default for all projects)" set to the wrong directory - /usr/share/lazarus instead of /usr/local/lazarus. When I corrected that, the linker errors disappeared and I was able to compile for Qt. Success!

Show quoted text 10 lines
Please use a fresh svn checkout of lazarus. Output of svn diff should be empty. Output svn info should be around Rev 34335. Use the latest stable fpc. Output fpc -iW should be 2.4.4 Use the latest binding. Please start fresh. Remove all libqtintf* and libQt4Pas* from /usr/lib/ or /usr/local/lib/ and compile and install a fresh binding. And for the moment use the plastique kde widget style.

Thank you for the suggestions - I might try them next as I'm having an issue with scrollbars that might have been resolved in svn.

Laird

Laird
to zeljko
zeljko wrote
What issue with scrollbars ?

Sorry about the delayed response - it took me a while to isolate the problem, and I was distracted by other things.

The problem seems to occur in the following minimal scenario: a form whose AutoScroll property is set to true, which contains a TStatusBar component and a client-aligned descendant of a TScrollBox component. The TScrollBox descendant - let's call it a TScrollBoxWithPanel - instantiates on its creation a TPanel component and sets that panel's parent to itself; its protected Resize procedure is overridden with the following code, where FPanel is the private property of TScrollBoxWithPanel used to store the created TPanel component:

   inherited;
   FPanel.Height := ClientHeight;

This scenario caused various problems depending on widgetset.

My mention of scrollbars in my last email referred to problems under the gtk2 widgetset: when the form is shrunk, form scrollbars appear and the TScrollBox component does not resize; when the form is resized past its "full scroll" width/height, then the scrollbars disappear again and the TScrollBox component resizes (by expanding) to client properly.

Under the qt widgetset, no scrollbars ever appear, but otherwise the behaviour is the same as under the gtk2 widgetset (i.e. when shrinking the form, the TScrollBox component does not resize, such that the status bar becomes hidden, and when the form is resized past its "full scroll" width/height, the TScrollBox component resizes to client properly and the status bar becomes visible again). Also, though, on initial display of the form, the bottom of the status bar is truncated; adding a TMainMenu component with at least one menu item results in even more of the bottom of the status bar being truncated. With or without the TMainMenu component, though, increasing the form's height reveals the hitherto truncated bottom of the status bar.

Setting the form's AutoScroll property to false "fixes" this behaviour under both widgetsets: in other words, scrollbars never appear, the TScrollBoxWithPanel component aligns to client and resizes properly, and the status bar is always visible and its bottom is never truncated.

I hope that answers your question - please let me know if you'd like more information.

Laird