That should come from /usr/include/openssl/ec.h
$ grep EC_KEY\; /usr/include/openssl/ec.h
typedef struct ec_key_st EC_KEY;
and ecdsa.h includes it:
#ifndef HEADER_ECDSA_H
#define HEADER_ECDSA_H
#include
#ifdef OPENSSL_NO_ECDSA
#error ECDSA is disabled.
#endif
#include