Bug 151095 - dcop kdelibs 3.5.8 compile errors, missing -lqt-mt
Summary: dcop kdelibs 3.5.8 compile errors, missing -lqt-mt
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 151098 152034 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-20 16:30 UTC by Frank Werner
Modified: 2008-04-21 19:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for compile problems kdelibs missing -lqt-mt (958 bytes, patch)
2007-10-20 16:32 UTC, Frank Werner
Details
Patch against stable CVS which fixes the missing qt problem (870 bytes, patch)
2008-04-21 18:45 UTC, Vincent Rubiolo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Werner 2007-10-20 16:30:25 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Compiled From Sources
Compiler:          gcc 4.2.1 
OS:                Linux

Compiling of kdelibs 3.5.8 produces the following error (3.5.7 compiles without any error):

make[4]: Entering directory `/tmp/kdelibs-3.5.8/dcop/dcopidl'
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../dcop -I../../kdecore -I../../kio/kssl -I../../kjs -I../../dcop -I../../libltdl -I../../kdefx -I../../kdecore -I../../kdecore -I../../kdecore/network -I../../kdeui -I../../kio -I../../kio/kio -I../../kio/kfile -I../.. -I/usr/lib/qt/include -I/usr/X11R6/include -I/opt/kde3.new/include  -DYYDEBUG -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
mv -f .deps/main.Tpo .deps/main.Po
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../dcop -I../../kdecore -I../../kio/kssl -I../../kjs -I../../dcop -I../../libltdl -I../../kdefx -I../../kdecore -I../../kdecore -I../../kdecore/network -I../../kdeui -I../../kio -I../../kio/kio -I../../kio/kfile -I../.. -I/usr/lib/qt/include -I/usr/X11R6/include -I/opt/kde3.new/include  -DYYDEBUG -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT yacc.o -MD -MP -MF .deps/yacc.Tpo -c -o yacc.o yacc.cc
mv -f .deps/yacc.Tpo .deps/yacc.Po
g++ -DHAVE_CONFIG_H -I. -I../.. -I../../dcop -I../../kdecore -I../../kio/kssl -I../../kjs -I../../dcop -I../../libltdl -I../../kdefx -I../../kdecore -I../../kdecore -I../../kdecore/network -I../../kdeui -I../../kio -I../../kio/kio -I../../kio/kfile -I../.. -I/usr/lib/qt/include -I/usr/X11R6/include -I/opt/kde3.new/include  -DYYDEBUG -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -MT scanner.o -MD -MP -MF .deps/scanner.Tpo -c -o scanner.o scanner.cc
scanner.cc:966:5: Warnung: »YY_STACK_USED« ist nicht definiert
scanner.cc:2200:5: Warnung: »YY_ALWAYS_INTERACTIVE« ist nicht definiert
scanner.cc:2494:5: Warnung: »YY_MAIN« ist nicht definiert
scanner.cc:2467: Warnung: »void* yy_flex_realloc(void*, yy_size_t)« definiert, aber nicht verwendet
mv -f .deps/scanner.Tpo .deps/scanner.Po
/bin/sh ../../libtool --silent --tag=CXX   --mode=link g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -R /opt/kde3.new/lib -R /opt/kde3.new/lib -R /usr/lib/qt/lib -R /usr/X11R6/lib  -o dcopidl main.o yacc.o scanner.o -lqt-mt  -lz -lpng -lz -lm -lXext -lX11  -lSM -lICE -lpthread
/usr/lib/gcc/i686-pc-linux-gnu/4.2.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lqt-mt
collect2: ld returned 1 exit status
make[4]: *** [dcopidl] Fehler 1
make[4]: Leaving directory `/tmp/kdelibs-3.5.8/dcop/dcopidl'
make[3]: *** [all-recursive] Fehler 1
make[3]: Leaving directory `/tmp/kdelibs-3.5.8/dcop'
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/tmp/kdelibs-3.5.8/dcop'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/tmp/kdelibs-3.5.8'
make: *** [all] Fehler 2

It seems that the linker does not find the QT libraries. The following patch resolves the problem:

----
diff -Nur kdelibs-3.5.8/dcop/dcopidl/Makefile.am kdelibs-3.5.8-fw/dcop/dcopidl/Makefile.am
--- kdelibs-3.5.8/dcop/dcopidl/Makefile.am      Sat Sep 10 10:27:23 2005
+++ kdelibs-3.5.8-fw/dcop/dcopidl/Makefile.am   Sat Oct 20 15:53:52 2007
@@ -11,7 +11,7 @@
 noinst_HEADERS = yacc.cc.h

 dcopidl_LDADD = $(LIB_QT)
-dcopidl_LDFLAGS = $(KDE_RPATH)
+dcopidl_LDFLAGS = $(all_libraries) $(KDE_RPATH)

 ####### Build rules

diff -Nur kdelibs-3.5.8/dcop/dcopidl2cpp/Makefile.am kdelibs-3.5.8-fw/dcop/dcopidl2cpp/Makefile.am
--- kdelibs-3.5.8/dcop/dcopidl2cpp/Makefile.am  Sat Sep 10 10:27:22 2005
+++ kdelibs-3.5.8-fw/dcop/dcopidl2cpp/Makefile.am       Sat Oct 20 15:56:59 2007
@@ -10,7 +10,7 @@
 noinst_HEADERS = main.h

 dcopidl2cpp_LDADD = $(LIB_QT)
-dcopidl2cpp_LDFLAGS = $(KDE_RPATH)
+dcopidl2cpp_LDFLAGS = $(all_libraries) $(KDE_RPATH)

 dcopidl_output.kidl: ../dcopidl/dcopidl $(srcdir)/dcopidl_test.h
        ../dcopidl/dcopidl $(srcdir)/dcopidl_test.h > dcopidl_output.kidl
----

I use gcc 4.2.1, GNU automake 1.10, qt 3.3.8, GNU libtool 1.5.24

My Linux is not a distribution, it's entire from scratch

My QT is under /usr/lib/qt/lib, this path is defined in /etc/ld.so.conf.

Frank
Comment 1 Frank Werner 2007-10-20 16:32:20 UTC
Created attachment 21873 [details]
Patch for compile problems kdelibs missing -lqt-mt
Comment 2 Pino Toscano 2007-10-20 19:11:09 UTC
*** Bug 151098 has been marked as a duplicate of this bug. ***
Comment 3 Pino Toscano 2007-11-09 01:05:52 UTC
*** Bug 152034 has been marked as a duplicate of this bug. ***
Comment 4 ndeb 2007-11-09 18:44:43 UTC
Adding $(AM_LDFLAGS) instead of $(all_libraries) works equally well because they are the same. Also, $(AM_LDFLAGS) should be used for consistency since it is also used in other linker variables like ->

CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
Comment 5 ndeb 2007-11-09 18:52:24 UTC
Similar link error in kdebase-3.5.8/kioslave/floppy on a RHEL3 system (gcc-3.2.3). Fixed by adding $(AM_LDFLAGS) after $(KDE_CXXFLAGS) in this line of the Makefile ->

kio_floppy_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
        $(CXXFLAGS) $(KDE_CXXFLAGS) $(kio_floppy_la_LDFLAGS) $(LDFLAGS) -o $@
Comment 6 ndeb 2007-11-09 18:55:46 UTC
Similar link error in kdebase-3.5.8/kioslave/smb on a RHEL3 system (gcc-3.2.3) and same fix as mentioned in bug 152034.
Comment 7 David Faure 2007-11-09 19:16:27 UTC
OK but hacking Makefiles is no real fix, what would be more useful would be Makefile.am patches.
Comment 8 ndeb 2007-11-09 19:18:13 UTC
Same link errors in on a RHEL3 system (gcc-3.2.3) ->

kcontrol/ebrowsing/plugins/shorturi
kcontrol/ebrowsing/plugins/localdomain

The fix is similar to that for bug 152034. In general, all the "*_la_LINK" variables in the Makefiles may need to include $(AM_LDFLAGS).
Comment 9 ndeb 2007-11-09 19:32:31 UTC
To comment 7, hacking Makefiles is to get the job done for myself. In all, these files definitely need fixing ->

kdelibs-3.5.8/dcop/dcopidl/Makefile.am
kdelibs-3.5.8/dcop/dcopidl2cpp/Makefile.am
kdebase-3.5.8/kioslave/smb/Makefile.am
kdebase-3.5.8/kcontrol/ebrowsing/plugins/shorturi/Makefile.am
kdebase-3.5.8/kcontrol/ebrowsing/plugins/localdomain/Makefile.am

As stated earlier, all the "*_la_LINK" variables (in Makefile) need to include $(AM_LDFLAGS). This should be possible by adding the AM_LDFLAGS to the "*_LDFLAGS" variable in the corresponding Makefile.am.
Comment 10 ndeb 2007-11-09 19:42:02 UTC
Forgot to list one failing directory. Here's the updated list ->

kdelibs-3.5.8/dcop/dcopidl/Makefile.am
kdelibs-3.5.8/dcop/dcopidl2cpp/Makefile.am
kdebase-3.5.8/kioslave/floppy/Makefile.am
kdebase-3.5.8/kioslave/smb/Makefile.am
kdebase-3.5.8/kcontrol/ebrowsing/plugins/shorturi/Makefile.am
kdebase-3.5.8/kcontrol/ebrowsing/plugins/localdomain/Makefile.am

The AM_LDFLAGS variable should be added to the "*_LDFLAGS" variable in each Makefile.am.
Comment 11 channelzero 2007-12-16 23:44:16 UTC
I think the problem is a change in Makefile.in from version 3.5.7 to 3.5.8
the corresponding line is:

 dcop/dcopidl/Makefile.in
-       $(CXXLINK) $(dcopidl_LDFLAGS) $(dcopidl_OBJECTS) $(dcopidl_LDADD) $(LIBS)
+       $(dcopidl_LINK) $(dcopidl_OBJECTS) $(dcopidl_LDADD) $(LIBS)


 dcop/dcopidl2cpp/Makefile.in
-       $(CXXLINK) $(dcopidl2cpp_LDFLAGS) $(dcopidl2cpp_OBJECTS) $(dcopidl2cpp_LDADD) $(LIBS)
+       $(dcopidl2cpp_LINK) $(dcopidl2cpp_OBJECTS) $(dcopidl2cpp_LDADD) $(LIBS)

This breaks linking if the libs are not in standard paths. Reverting these changes and the build worked again.
Comment 12 Vincent Rubiolo 2008-04-16 16:20:03 UTC
The issue still exists on 3.5.9 (RHEL4 using the system-installed QT under /usr/lib/qt-3.3). None of the configure --with-qt-* options changed anything.

I have tried to patch the abovementioned (comment 10) Makefiles.am w/ AM_LDFLAGS and regenerating w/ automake-1.10.1/autoconf-2.61 but the build (with the same configure line) now fails earlier w/ a missing dcopserver.moc file :
make[4]: Entering directory `/folk/vrubiolo/Archives/kde-3.5.9-build/kdelibs-3.5.9/dcop'
/bin/sh ../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I../kdecore -I../kio/kssl -I../kjs -I../dcop -I../libltdl -I../kdefx -I../kdecore -I../kdecore -I../kdecore/network -I../kdeui -I../kio -I../kio/kio -I../kio/kfile -I.. -I/usr/lib/qt-3.3/include -I/usr/X11R6/include -I/folk/vrubiolo/InstalledProgs/KDE-3.5.9/include   -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align-Wchar-subscripts -Wall -W -Wpointer-arith -O2 -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -MT dcopserver.lo -MD -MP -MF .deps/dcopserver.Tpo -c -o dcopserver.lo dcopserver.cpp
dcopserver.cpp:1788:26: error: dcopserver.moc: No such file or directory
dcopserver.cpp: In constructor 'DCOPServer::DCOPServer(bool)':
dcopserver.cpp:1037: warning: 'dcopServerFileOld' is deprecated (declared at ./dcopclient.h:728)
dcopserver.cpp: In function 'int kdemain(int, char**)':
dcopserver.cpp:1694: warning: 'dcopServerFileOld' is deprecated (declared at ./dcopclient.h:728)
dcopserver.cpp:1697: warning: 'dcopServerFileOld' is deprecated (declared at ./dcopclient.h:728)
make[4]: *** [dcopserver.lo] Error 1
make[4]: Leaving directory `/folk/vrubiolo/Archives/kde-3.5.9-build/kdelibs-3.5.9/dcop'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/folk/vrubiolo/Archives/kde-3.5.9-build/kdelibs-3.5.9/dcop'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/folk/vrubiolo/Archives/kde-3.5.9-build/kdelibs-3.5.9/dcop'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/folk/vrubiolo/Archives/kde-3.5.9-build/kdelibs-3.5.9'
make: *** [all] Error 2

I am not so familiar w/ the KDE build system so I have not proceeded any further (seems like I need to regen moc files, dunno how to do that). I have changed the Makefile.in as follows instead :
$ diff -u dcop/dcopidl/Makefile.in dcop/dcopidl/Makefile.in.bak
--- dcop/dcopidl/Makefile.in    2008-04-16 16:09:27.000000000 +0200
+++ dcop/dcopidl/Makefile.in.bak        2008-04-16 16:08:33.000000000 +0200
@@ -410,7 +410,7 @@
 dcopidl_SOURCES = main.cpp yacc.cc scanner.cc
 noinst_HEADERS = yacc.cc.h
 dcopidl_LDADD = $(LIB_QT)
-dcopidl_LDFLAGS = $(KDE_RPATH) $(AM_LDFLAGS)
+dcopidl_LDFLAGS = $(KDE_RPATH)
 EXTRA_DIST = dcopidl_test.h scanner.ll yacc.yy
 MAINTAINERCLEANFILES = yacc.cc.output
 #>- all: all-am

and 

$ diff -u dcop/dcopidl2cpp/Makefile.in dcop/dcopidl2cpp/Makefile.in.bak
--- dcop/dcopidl2cpp/Makefile.in        2008-04-16 16:10:49.000000000 +0200
+++ dcop/dcopidl2cpp/Makefile.in.bak    2008-04-16 16:10:43.000000000 +0200
@@ -411,7 +411,7 @@
 dcopidl2cpp_SOURCES = main.cpp skel.cpp stub.cpp stubimpl.cpp
 noinst_HEADERS = main.h
 dcopidl2cpp_LDADD = $(LIB_QT)
-dcopidl2cpp_LDFLAGS = $(KDE_RPATH) $(AM_LDFLAGS)
+dcopidl2cpp_LDFLAGS = $(KDE_RPATH)
 #>- all: all-am
 #>+ 1
 all: docs-am  all-am

This fixed the build issue for kdelibs.
Comment 13 David Faure 2008-04-18 10:15:17 UTC
If you patch Makefile.am, and "make" doesn't do the right thing, you should then run "make -f Makefile.cvs" to regenerate the Makefile.in files. Do not run automake/autoconf by hand!

I am quite confused by this report, because comment #12 suggests to remove AM_LDFLAGS from foo_LDFLAGS, while comment #10 says to add AM_LDFLAGS to foo_LDFLAGS. 
The initial patch (comment #1) makes sense to me, but according to comment #10 it's not enough, other dirs need to be patched as well?
Comment 14 Vincent Rubiolo 2008-04-21 18:44:03 UTC
I have retried building kdelibs from the CVS stable version and can confirm the problem still occurs. Based on the reporter's patch, I am including a Makefile.am patch against stable CVS which solves the issue.

Contrary to what comment #10 says, only kdelibs needed fixing for me as kdebase built fine from the 3.5.9 tarballs (I have also tried to assess that from the stable CVS but it does not build because of an unrelated error in doc/kdeprint).

I hope this gets the issue sorted out.
Comment 15 Vincent Rubiolo 2008-04-21 18:45:38 UTC
Created attachment 24474 [details]
Patch against stable CVS which fixes the missing qt problem

Reporter's patch fixing the missing QT issue against stable CVS (generated with
svn diff).
Comment 16 David Faure 2008-04-21 19:05:49 UTC
SVN commit 799487 by dfaure:

Apply patch from 151095, to fix "dcop kdelibs 3.5.8 compile errors, missing -lqt-mt".
I guess some recent versions of automake don't support file-global AM_LDFLAGS.
In fact it would have been more common to write $(all_libraries) directly in those changed lines, but well, this patch has been tested so I'm not taking chances.
BUG: 151095


 M  +1 -1      dcopidl/Makefile.am  
 M  +1 -1      dcopidl2cpp/Makefile.am  


WebSVN link: http://websvn.kde.org/?view=rev&revision=799487