compile problem on aix

When compiling (a simple test program):

#include <stdio.h>
#include <sys/context.h>

int main() {
printf("Hello\n");
return 0;
}

on AIX 5.2 with gcc 3.2.2 from the IBM site I get the following error:

/usr/include/sys/context.h:169: parse error before "sigset64_t"
/usr/include/sys/context.h:172: parse error before '}' token

Does anyone know how to solve this?

I haven't personally used AIX before, but similar errors happen to me under linux and solaris for all kinds of system headers.. Two things:

  • Include context.h first. Some system headers puke when you include higher-level things like stdio above them.
  • Some other header might be needed to tell it what a sigset64_t is, maybye sys/types.h or sys/signal.h or something like that

I tried both options but it didn't work. Where is sigset64_t set on AIX? What does this mean or do?

I'm thinking maybe if I include the header or library where this is set it might work. Does anyone know?

Found something. It may be a gcc compatibility issue, with gcc not defining the right values for the AIX headers to figure out if they're supposed to be 32-bit or 64-bit.

I'm on a 64bit power pc 5 system. I've set the flag -maix64 manually. I don't think this is necessary because in the specs for gcc I see that it's already set to 64bit. I think I tried al solutions that google turns up in discussion groups already ...