underlinking and resulting link error with gold

1 view
Skip to first unread message

Christoph Mende

unread,
May 15, 2011, 10:44:25 AM5/15/11
to qmpdclient
Hi,

I just received https://bugs.gentoo.org/show_bug.cgi?id=367365 which
explains a link-time error with qmpdclient that happens because it is
not explicitly linked against libX11. I'm not quite sure _why_ this
happens, considering that X11 is listed in find_package(), but then
again my cmake-fu is pretty weak. Anyway, I managed to fix this with
the following patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28fd3b4..4197a69 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.6)

-find_package(Qt4 4.4.0 COMPONENTS QtCore QtGui QtNetwork QtXml
QtXmlPatterns REQUIRED QtDBus X11)
+find_package(Qt4 4.4.0 COMPONENTS QtCore QtGui QtNetwork QtXml
QtXmlPatterns REQUIRED QtDBus)
+find_package(X11 REQUIRED)

SET (QT_USE_QTNETWORK TRUE)
SET (QT_USE_QTXMLPATTERNS TRUE)
@@ -279,6 +280,7 @@ add_definitions(-DNAMEVER="${NAMEVER}" -DPREFIX="$
{CMAKE_INSTALL_PREFIX}" -DVERS
add_executable(qmpdclient ${QMPDClient_srcs} ${QMPDClient_ppd_hdrs} $
{QMPDClient_ppd_uis} ${QMPDClient_ppd_res} ${COMPILED_TRANSLATIONS})

target_link_libraries(qmpdclient ${QT_LIBRARIES})
+target_link_libraries(qmpdclient ${X11_LIBRARIES})

install(TARGETS qmpdclient DESTINATION bin)
if(UNIX)

voker57

unread,
May 30, 2011, 11:54:06 AM5/30/11
to qmpdc...@googlegroups.com
Hi

Your patch seems to be broken by automatic line breaking. Can you please re-send it?

signature.asc

voker57

unread,
May 30, 2011, 2:43:23 PM5/30/11
to qmpdc...@googlegroups.com
Actually, never mind. I fixed and applied your patch, thanks.
signature.asc
Reply all
Reply to author
Forward
0 new messages