C Enum reference undefined, yet sitting in a included header file?

1k Views Asked by At

So, I'm playing with GNUTLS, and it has this enum:

typedef enum {
    GNUTLS_PK_UNKNOWN = 0,
    GNUTLS_PK_RSA = 1,
    GNUTLS_PK_DSA = 2,
    GNUTLS_PK_DH = 3,
    GNUTLS_PK_EC = 4
} gnutls_pk_algorithm_t;

sitting in it's main header file(gnutls.h, version 3.3.17). I reference it here:

    unsigned int bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_LEGACY);

(right out of the example). I do have the #include <gnutls/gnutls.h>, and that all seems to reference fine(other enums are fine, except for GNUTLS_X509_FMT_PEM). I read something about the compiler not seeing gnutls.h, and it is in /usr/local/include and not /usr/include, however I do have that in the Includes side thing in Eclipse. If it is a compiler-not-finding-it, why is it finding some values, and how do I make it find it? If not, what is the issue?

1

There are 1 best solutions below

0
On BEST ANSWER

how to find? add -I/usr/local/include to your gcc command line, or CFLAGS in the makefile, or look here for how to add it in eclipse

If the compiler is finding some values while not finding the include, maybe they defined elsewhere. try to redefine them, and look in the error where the other definition is. to redefine you can declare as different type, (like: typedef int whatever;, to see if and where whatever declared) since if it is the same typedef it may considered as a forward deceleration.