[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

heimdal-1.0.1 and C++ - compilation fails


In heimdal 1.0.1 (linux-2.6.20) in krb5.h there are various types
defined in a way of :
typedef struct foo* foo;

This code causes a "conflicting declaration" error once included by
C++ code. That's since in C++ foo is already an alias to struct foo,
therefore it is a redefinition.

Sample program:

#include <krb5.h>
int main() {
    return 0;

g++ mytest.cc
In file included from mytest.cc:1:
/usr/include/krb5.h:79: error: conflicting declaration 'typedef

gcc version is 3.4.3

If I rename mytest.cc to mytest.c and use gcc, then everything is OK.

Is it a bug or a feature? - I do want to use kerberos includes in my C++ code.