title: OpenSSL: print X and Y of EC_POINT
body: <p>This is my code:</p>
  
  <pre><code>EC_KEY *eckey = EC_KEY_new();
  EC_KEY_generate_key(eckey);
  const EC_POINT *pub = EC_KEY_get0_public_key(eckey);
  printf("%s", pub-&gt;X);
  </code></pre>
  
  <p>I'm getting an error that says "Incomplete definition of type 'struct ec_point_st'". I also tried:</p>
  
  <pre><code>EC_GROUP *curve = EC_GROUP_new_by_curve_name(NID_secp521r1);
  BN_CTX *ecctx= BN_CTX_new();
  EC_KEY *eckey = EC_KEY_new();
  EC_KEY_generate_key(eckey);
  const EC_POINT *pub = EC_KEY_get0_public_key(eckey);
  NSLog(@"%s", EC_POINT_point2hex(curve, pub, POINT_CONVERSION_HYBRID, ecctx));
  </code></pre>
  
  <p>in which case I'm getting an EXC_BAD_ACCESS error. How can I print (for debugging) the x and y points of the public key?</p>