Ken Moffat wrote:
On Thu, Oct 05, 2006 at 05:49:49PM +0100, Matthew Burgess wrote:
Hi folks,

I'm trying to compile kdebase-3.5.4 against the headers installed via 'make headers_install' from linux-2.6.18. Unfortunately, I get this error:

error: '__s64' does not name a type
/usr/include/linux/joystick.h:132: error: '__s64' does not name a type

Now, obviously that's not good, but I don't think it's kdebase's fault (linux/joystick.h is installed afterall, so they're using a permitted API).

The problem seems to be that linux/joystick.h is #including asm/types.h which only typedefs __s64 if __GNUC__ is defined and __STRICT_ANSI__ isn't defined:

#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
typedef __signed__ long long __s64;
typedef unsigned long long __u64;

I can only presume, because of the error above, that those conditions aren't being met, but a cursory glance of the logfile doesn't appear to help me ascertain which one of them is triggering the problem above.

Any ideas, folks?



 as a starter, something crude like this for a separate program,
e.g. types.c.

#include <stdlib.h>
#include <stdio.h>
#include <linux/joystick.h>

main() {
#if defined(__GNUC__)
        printf("__GNUC__ is defined\n");
        printf("__GNUC__ is NOT defined\n");

#if defined(__STRICT_ANSI__)
        printf("__STRICT_ANSI__ is defined\n");
        printf("__STRICT_ANSI__ is NOT defined\n");

If I compile and run this on pure64 using the CLFS headers, I get

[EMAIL PROTECTED] ~ $./types
__GNUC__ is defined
__STRICT_ANSI__ is NOT defined

Likewise.  I think I've figured it out.  Try compiling that with:

# gcc -ansi -o types types.c

and you'll get:

In file included from types.c:3:
/usr/include/linux/joystick.h:131: error: expected specifier-qualifier-list before ‘__s64’

Taking a look at /usr/include/features.h we see:

The `-ansi' switch to the GNU C compiler defines __STRICT_ANSI__.

It just so happens that the compilation of kdebase uses the -ansi switch, hence the compilation problem. Now, I still don't know what the correct solution is. Do we just kill the -ansi flag from kdebase's compilation? Looking at linux/joystick.h, I can't see a way of fixing it as int64_t isn't an ANSI type, right?



Unsubscribe: See the above information page

Reply via email to