Bug 86188 - kdemultimedia gets compile errors
Summary: kdemultimedia gets compile errors
Status: RESOLVED FIXED
Alias: None
Product: kdemultimedia
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: HI normal
Target Milestone: ---
Assignee: Multimedia Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-28 20:00 UTC by Giovanni Venturi
Modified: 2004-12-11 21:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Makes mpeglib compile on slackware 10. (566 bytes, patch)
2004-08-23 04:33 UTC, Jan de Visser
Details
Patch to correct "undefined __u64" (385 bytes, patch)
2004-09-06 02:26 UTC, Alain Crespo
Details
cdromAccess_Linux.cpp changed and my old patch wouldn't apply anymore. (526 bytes, patch)
2004-09-11 14:38 UTC, Jan de Visser
Details
This time the patch actually *works* (529 bytes, patch)
2004-09-11 14:46 UTC, Jan de Visser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Giovanni Venturi 2004-07-28 20:00:36 UTC
Version:           unknown (using KDE 3.2.92 (3.3 beta2), compiled sources)
Compiler:          gcc version 3.3.4
OS:                Linux (i686) release 2.6.7

Compiling on Linux 2.6.7 kdemultimedia from CVS HEAD I got these errors:

make[5]: Leaving directory `/home/paride/compilati/kdemultimedia/mpeglib/lib/util'
make[4]: Leaving directory `/home/paride/compilati/kdemultimedia/mpeglib/lib/util'
Making all in input
make[4]: Entering directory `/home/paride/compilati/kdemultimedia/mpeglib/lib/input'
if /bin/sh ../../../libtool --silent --mode=compile --tag=CXX g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I/opt/kde3/include -I/usr/lib/qt-copy/include -I/usr/X11R6/include   -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -g3 -fno-inline -march=athlon-xp -mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -fpermissive -MT cdromAccess.lo -MD -MP -MF ".deps/cdromAccess.Tpo" -c -o cdromAccess.lo cdromAccess.cpp; \
then mv -f ".deps/cdromAccess.Tpo" ".deps/cdromAccess.Plo"; else rm -f ".deps/cdromAccess.Tpo"; exit 1; fi
make[4]: Leaving directory `/home/paride/compilati/kdemultimedia/mpeglib/lib/input'
make[3]: Leaving directory `/home/paride/compilati/kdemultimedia/mpeglib/lib'
make[2]: Leaving directory `/home/paride/compilati/kdemultimedia/mpeglib'
make[1]: Leaving directory `/home/paride/compilati/kdemultimedia'
 as a type.
/usr/include/asm/byteorder.h:43: error: parse error before `}' token
/usr/include/asm/byteorder.h:44: error: syntax error before `.' token
/usr/include/asm/byteorder.h:50: error: syntax error before `.' token
/usr/include/asm/byteorder.h:51: error: syntax error before `.' token
/usr/include/asm/byteorder.h:52: error: parse error before `:' token
In file included from /usr/include/linux/byteorder/little_endian.h:11,
                 from /usr/include/asm/byteorder.h:65,
                 from /usr/include/linux/cdrom.h:14,
                 from cdromAccess_Linux.cpp:17,
                 from cdromAccess.cpp:33:
/usr/include/linux/byteorder/swab.h:199: error: syntax error before `(' token
/usr/include/linux/byteorder/swab.h:209: error: syntax error before `(' token
/usr/include/linux/byteorder/swab.h:213: error: `__u64' was not declared in 
   this scope
/usr/include/linux/byteorder/swab.h:213: error: `addr' was not declared in this 
   scope
/usr/include/linux/byteorder/swab.h:214: error: variable or field `__swab64s' 
   declared void
/usr/include/linux/byteorder/swab.h:214: error: `__swab64s' declared as an 
   `inline' variable
/usr/include/linux/byteorder/swab.h:214: error: syntax error before `{' token
make[4]: *** [cdromAccess.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I remember these kind of errors with KDE 3.1.x with newer kernel linux 2.4 and 2.6.x, but these errors disappeared with KDE 3.2, now they appears again. Why?
Comment 1 Michael 2004-08-21 12:01:25 UTC
I'm having the exact same problem (under Slackware 10.0, and with KDE 3.3 final)...  I'm going to try installing the binary package and removing kdemultimedia from the konstruct compile package list, but it would be nice if this was fixed as well.
Comment 2 Chris Clayton 2004-08-22 13:22:54 UTC
kdemultimedia v 3.2.3 compiled fine on my system with its kernel 2.4.23 headers, but v 3.3.0 fails. This patch restores the former happy state (by restoring mpeglib/lib/input/cdromAccess_Linux.cpp to its v 3.2.3 state):

--- kdemultimedia-3.3.0/mpeglib/lib/input/cdromAccess_Linux.cpp 2004-05-22 20:56:58.000000000 +0000
+++ kdemultimedia-3.2.3/mpeglib/lib/input/cdromAccess_Linux.cpp 2003-10-26 10:55:50.000000000 +0000
@@ -13,6 +13,10 @@

 #include "cdromToc.h"
 #include "cdromRawAccess.h"
+#ifndef __GNUC__
+#define __GNUC__ 1
+#endif
+#undef __STRICT_ANSI__
 #include <asm/types.h>
 #include <linux/cdrom.h>
 #include <sys/ioctl.h>
Comment 3 Chris Clayton 2004-08-22 14:48:34 UTC
A bit more investigation shows that this code from mpeglib/lib/input/cdromAccess.cpp seems to be trying to overcome the problem:

#ifdef OS_Linux
  #include <linux/version.h>
  #include <sys/types.h>
  #ifndef __u64
  #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,70)
  typedef unsigned long long __u64;
  #endif
  #endif
  #include "cdromAccess_Linux.cpp"
#endif

I'm happy to be corrected, but I think that, on i386, "#ifndef __u64" will always be true because __u64 is a typedef (rather than a #define) to unsigned long long in asm/types.h. But then the "local" typedef is guarded and only "executes" if the kernel is 2.5.70 or later. As I said in the previous post, my headers are from 2.4.23. I guess 2.5 changes must have been backported.
It looks to me as if the only real way to overcome this is through an entry in config.h (HAVE___U64?), but setting up the gnu build system is a complete mystery to me, so I can't help there, sorry
Comment 4 Jan de Visser 2004-08-23 04:33:51 UTC
Created attachment 7230 [details]
Makes mpeglib compile on slackware 10.

I posted this a while ago to kde-devel and kde-multimedia, not knowing there
was a bugreport. I've lifted the code from k3b, where it appears to work pretty
well...
Comment 5 Giovanni Venturi 2004-08-23 09:54:05 UTC
Well, If I can do I commit this changes and I close this bug. Can I commit it?

Comment 6 Andrey V. Panov 2004-09-02 03:51:49 UTC
Removing of "-ansi" option also helps.
Comment 7 Alain Crespo 2004-09-06 02:26:22 UTC
Created attachment 7426 [details]
Patch to correct "undefined __u64"

If __u64 can be redefined as unsigned long long.
This patch does this.
Comment 8 Giovanni Venturi 2004-09-08 10:55:58 UTC
With this it compiles? Can I commit it or is not good? If it's not good can someone explain me why? I don't think under Slackware I have to use workaround to compile. I'd like to have a kdemultimedia package that compile on his own.
Comment 9 Giovanni Venturi 2004-09-08 10:58:27 UTC
Sorry it's not a question. I tryed and it compiles.
Comment 10 Jan de Visser 2004-09-11 14:30:28 UTC
Can someone please commit one of the two provided patches? This is *so* annoying.
Comment 11 Jan de Visser 2004-09-11 14:38:51 UTC
Created attachment 7486 [details]
cdromAccess_Linux.cpp changed and my old patch wouldn't apply anymore.
Comment 12 Jan de Visser 2004-09-11 14:46:16 UTC
Created attachment 7487 [details]
This time the patch actually *works*

I'm an idiot. Didn't actually test the previous patch. This one works.
Comment 13 Giovanni Venturi 2004-09-11 23:13:15 UTC
Well, some people of kdemultimedia told me on IRC these patches cannot be committed because on others platforms can cause the same problem I have on Linux Slackware. I think this bug will stay open for a lot of time. Maybe it will never be closed.
Comment 14 Jan de Visser 2004-09-12 02:22:39 UTC
So, would those people care to explain that again in this bugreport? I find it odd, because k3b uses the same trick (#undef __STRICT_ANSI__, that is),

Does anybody know what slack did to the kernel headers to break this? Is it something that should be reported to slackware.org?

As an aside, IMHO bugs should not just be discussed on IRC. As a minimum post the IRC logs here for the benefit of the people that didn't happen to lurk on IRC at that time.
Comment 15 Ismail Donmez 2004-09-12 11:00:06 UTC
Its a kernel header problem not Slackware problem.
Comment 16 Stephan Kulow 2004-10-17 16:08:32 UTC
CVS commit by coolo: 

work around buggy kernel headers
BUG:86188


  M +7 -0      cdromAccess_Linux.cpp   1.9


--- kdemultimedia/mpeglib/lib/input/cdromAccess_Linux.cpp  #1.8:1.9
@@ -11,6 +11,13 @@
  */
 
+#ifdef __STRICT_ANSI__
+#undef __STRICT_ANSI__
+#define _ANSI_WAS_HERE_
+#endif
 #include <linux/types.h>
 #include <linux/cdrom.h>
+#ifdef _ANSI_WAS_HERE_
+#define __STRICT_ANSI__ 
+#endif
 #include <sys/ioctl.h>
 


Comment 17 Jan de Visser 2004-10-18 03:26:52 UTC
So this is basically the patch I suggested, somewhat bombproofed. What changed, besides coolo's karma, that this is all of a sudden acceptable?
Comment 18 James Richard Tyrer 2004-10-31 06:20:10 UTC
Yes, this works now.  It will build without the: "--disable-warnings" paramater for the 'configure' script.

Please backport to 3.3 branch by moving the CVS tag: "KDE_3_3_BRANCH" from 1.7 to 1.9.

--
JRT
Comment 19 Michael Müller 2004-12-11 21:57:14 UTC
Please apply this Patch to 3.3.3 and later, because 3.3.2 is still missing it :o(