Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#5177 closed patch (fixed)

qt4 link libdir order incorrect

Reported by: Mark Spieth Owned by: Anduin Withers
Priority: minor Milestone: unknown
Component: mythtv Version: unknown
Severity: medium Keywords:
Cc: Ticket locked: no

Description

when building with qt4 qmake, the makefiles generated have -L/usr/lib before all other -L directives.

this means any libs installed in /usr/lib will be used in preference to the desired ones in the build tree.

patches attached for mythtv and mythplugins

also attached is a sample of how to build mythplugins against a mythtv build tree. it is included before the first INCLUDEPATH in settings.pro of mythplugins.

Attachments (3)

mythtv_qt4libdir.2.patch (9.0 KB) - added by Mark Spieth 12 years ago.
mythplugins_qt4libdir.2.patch (643 bytes) - added by Mark Spieth 12 years ago.
settings_mrs.pro (476 bytes) - added by Mark Spieth 12 years ago.

Download all attachments as: .zip

Change History (11)

Changed 12 years ago by Mark Spieth

Attachment: mythtv_qt4libdir.2.patch added

Changed 12 years ago by Mark Spieth

Changed 12 years ago by Mark Spieth

Attachment: settings_mrs.pro added

comment:1 Changed 12 years ago by Anduin Withers

Owner: changed from Isaac Richards to Anduin Withers
Status: newassigned

comment:2 Changed 11 years ago by Nigel

1) This is only a problem for people who use --prefix=/usr (e.g. KnoppMyth?)
2) After some recent lib changes, programs/* linking had a several problems (lots of globalsettings.o:(.rodata._ZTV12HostComboBox[vtable for HostComboBox?]+0x8c): undefined reference to `SelectSetting::ReplaceLabel?(QString const&, QString const&)'). I could have purged /usr/lib/libmyth*, but remembered this ticker, and experimented a little. The following got me a clean build, and is a much simpler way to exclude /usr/lib:

Index: settings.pro
===================================================================
--- settings.pro        (revision 17609)
+++ settings.pro        (working copy)
@@ -109,6 +109,10 @@
 }
 QMAKE_LIBDIR_OPENGL =
 
+# Qt 4 has /usr/libs early in the link line, which can cause link errors
+# (due to old libmyth* in there).  # This works around that:
+QMAKE_LIBDIR_QT =
+
 EXTRA_LIBS = $$FREETYPE_LIBS -lmp3lame
 EXTRA_LIBS += $$CONFIG_AUDIO_OSS_LIBS
 EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS

Mark + others, can you tell me if it works for you?

comment:3 Changed 11 years ago by Anduin Withers

(In [17613]) References #5177

Modifies the library search order; find the libs you just built before their predecessors.

Handle the case where QMAKE_LIBDIR_QT is /usr/lib to prevent trouble with --prefix=/usr.

comment:4 Changed 11 years ago by Nigel

Anduin , I suspect that if Qt was installed -prefix /usr/local/lib, then the problem would still occur. Maybe the fix should be

QMAKE_LIBDIR_QT -= $${PREFIX}/lib

comment:5 Changed 11 years ago by Nigel

Closed by [17961] ?

comment:6 Changed 11 years ago by Anduin Withers

Resolution: fixed
Status: assignedclosed

Yes, looks fine to me, thanks for completing this one.

comment:7 Changed 11 years ago by Janne Grunau

(In [18751]) If we have to add a library directory which could contain old mythtv libraries make sure it comes after the build directories. Refs #5177

comment:8 Changed 11 years ago by Nigel

(In [18988]) Corrections to library ordering. EXTRA_LIBS can contain the MythTV lib install location, so it must come after all local source relative -L. Refs #5177. Closes #5885.

Note: See TracTickets for help on using tickets.