wine-20040213 doesn't compile on Linux w/ 2.6.3 kernel and gcc-3.3.3

Tom Williams tomdkat at
Sun Mar 7 09:34:09 CST 2004

Thanks for the info. I tried building wine with __KERNEL__ after I 
posted my message and got past this problem but encountered TONS more so 
that was obviously NOT the solution.  :)

I'll look into doing what you describe below.  :)



P. Christeas wrote:

>I had found the same problem, and now compile Wine with 2.6.x ..
>This is a kernel problem, wine doesn't need to be modified at all. There was 
>indeed a trivial patch at lkml, but hasn't still been applied (i wonder why).
>First of all, you should *not* compile any userspace program with the 
>__KERNEL__ flag. These headers need to know that they aren't being used by 
>the kernel code.
>The problem is that the scsi headers (and cdrom AFAIK) use the kernel 
>definitions of types, not the global ones. The kernel looks like '__u16' 
>while the global is 'u16' etc. Since the headers are meant to be used by 
>userspace programs, they should have been using the global (like 'u16') ones.
>It's therefore IMHO absolutely safe and sound to patch your kernel headers and 
>replace these types. Then, wine and others will compile correctly.
>>I had successfully built wine-20040213 before upgrading to the 2.6.3
>>Linux kernel and XFree86 4.4.0.  After upgrading to XFree86 4.4.0 (from
>>source distribution), wine would crash when I would try to run a Windows
>>app so I decided to rebuild wine so it would use the XFree86 4.4.0
>>headers and libs, etc.
>>Now, when I compile wine-20040213, it stops with this compile error:
>>make[2]: Leaving directory `/build/wine-20040213/dlls/newdev'
>>make[2]: Entering directory `/build/wine-20040213/dlls/ntdll'
>>gcc -c -I. -I. -I../../include -I../../include  -D__WINESRC__
>>-D_NTSYSTEM_ -D_REENTRANT -fPIC -Wall -pipe -mpreferred-stack-boundary=2
>>-fno-strict-aliasing -gstabs+ -Wpointer-arith  -g -O2 -o cdrom.o cdrom.c
>>In file included from /usr/include/linux/cdrom.h:14,
>>                 from cdrom.c:63:
>>/usr/include/asm/byteorder.h:14: error: syntax error before "__u32"
>>/usr/include/asm/byteorder.h:28: error: syntax error before "__u64"
>>In file included from /usr/include/linux/byteorder/little_endian.h:11,
>>                 from /usr/include/asm/byteorder.h:57,
>>                 from /usr/include/linux/cdrom.h:14,
>>                 from cdrom.c:63:
>>/usr/include/linux/byteorder/swab.h:133: error: syntax error before "__u16"
>>/usr/include/linux/byteorder/swab.h:146: error: syntax error before "__u32"
>>/usr/include/linux/byteorder/swab.h:160: error: syntax error before "__u64"
>>make[2]: *** [cdrom.o] Error 1
>>make[2]: Leaving directory `/build/wine-20040213/dlls/ntdll'
>>make[1]: *** [ntdll] Error 2
>>make[1]: Leaving directory `/build/wine-20040213/dlls'
>>make: *** [dlls] Error 2
>>tom at linux:~/build/wine-20040213$
>>Based on this discussion on the gcc-help mailing list:
>>it looks like the "__KERNEL__" option needs to be specified so that
>>__attribute_const__ can be properly defined and cdrom.c can then be
>>I haven't tried it yet but I'm guessing adding __KERNEL__ to the
>>"extradefs" macro in the dlls/ntdll/ file might do the
>>trick.  I'm going to try that now and see what happens.
>>Has this problem already been encountered and addressed?

More information about the wine-devel mailing list