title: How to use <openssl/md5.h> with CodeBlocks?
body: <p>I want to use MD5 function of openSSL : I compile my project with CodeBlocks (Windows 10/ GNU GCC)</p>
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;openssl/md5.h&gt;
  
  int main()
  {
      unsigned char radiusPayload[] = {
          0x01, 0x01, 0x00, 0x8B, 0xEA, 0xBE, 0x2A, 0xEF, 0x43, 0xBC, 0x67, 0x8E, 0x9E, 0xF2, 0x49, 0xC9,
          0xF3, 0xF1, 0xA0, 0x35, 0x20, 0x0F, 0x4E, 0x41, 0x53, 0x5F, 0x49, 0x44, 0x5F, 0x30, 0x30, 0x30,
          0x30, 0x30, 0x31, 0x01, 0x1D, 0x68, 0x6F, 0x73, 0x74, 0x2F, 0x50, 0x43, 0x30, 0x30, 0x30, 0x30,
          0x30, 0x30, 0x31, 0x2E, 0x64, 0x6F, 0x6D, 0x61, 0x69, 0x6E, 0x2E, 0x6C, 0x6F, 0x63, 0x61, 0x6C,
          0x05, 0x04, 0x00, 0x05, 0x1F, 0x13, 0x32, 0x43, 0x2D, 0x46, 0x30, 0x2D, 0x35, 0x44, 0x2D, 0x43,
          0x39, 0x2D, 0x35, 0x38, 0x2D, 0x41, 0x41, 0x4F, 0x22, 0x02, 0x01, 0x00, 0x20, 0x01, 0x68, 0x6F,
          0x73, 0x74, 0x2F, 0x50, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x2E, 0x64, 0x6F, 0x6D,
          0x61, 0x69, 0x6E, 0x2E, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x50, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00,
          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
      };
  
      unsigned char authenticator_message[16];
  
      MD5_CTX c;
      MD5_Init(&amp;c);
      MD5_Update(&amp;c, radiusPayload, sizeof(radiusPayload));
      MD5_Final(authenticator_message, &amp;c);
  
      printf(&quot;authenticator_message : %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n&quot;,
          authenticator_message[0], authenticator_message[1], authenticator_message[2], authenticator_message[3],
          authenticator_message[4], authenticator_message[5], authenticator_message[6], authenticator_message[7],
          authenticator_message[8], authenticator_message[9], authenticator_message[10], authenticator_message[11],
          authenticator_message[12], authenticator_message[13], authenticator_message[14], authenticator_message[15]
      );
  
      return 0;
  } 
  </code></pre>
  <p>I have errors :</p>
  <pre><code>undefined reference to `MD5_Init'
  undefined reference to `MD5_Update'
  undefined reference to `MD5_Final'
  </code></pre>
  <p>I did :</p>
  <ul>
  <li>Installed OpenSSL</li>
  <li>project build option &gt; search directories &gt; Compiler &gt; &quot;C:\Program Files\OpenSSL-Win64\include&quot;</li>
  <li>project build option &gt; linker settings &gt; link librairies &gt; I added &quot;libcrypto.lib&quot;, &quot;libssl.lib&quot; and &quot;openssl.lib&quot; of directory &quot;C:\Program Files\OpenSSL-Win64\lib&quot;</li>
  </ul>
  <p>If I comment &quot;#include &lt;openssl/md5.h&gt;&quot;, I have errors :</p>
  <pre><code>unknown type name 'MD5_CTX'
  implicit declaration of function 'MD5_Init' [-Wimplicit-function-declaration]
  implicit declaration of function 'MD5_Update' [-Wimplicit-function-declaration]
  implicit declaration of function 'MD5_Final' [-Wimplicit-function-declaration]
  </code></pre>
  <p>Build logs :</p>
  <pre><code>gcc.exe -Wall -g -I&quot;C:\Program Files\OpenSSL-Win64\include&quot; -c &quot;C:\Test_radius\Test_radius_authenticator_msg\main.c&quot; -o obj\Debug\main.o
  gcc.exe  -o bin\Debug\Test_radius_authenticator_msg.exe obj\Debug\main.o   &quot;C:\Program Files\OpenSSL-Win64\lib\libcrypto.lib&quot; &quot;C:\Program Files\OpenSSL-Win64\lib\libssl.lib&quot; &quot;C:\Program Files\OpenSSL-Win64\lib\openssl.lib&quot;
  </code></pre>
  <p>How can I do to compile my project ?</p>