title: Can't link OpenSSL code
body: <p>I am trying to build an openssl simple program. Here is the complete code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include "openssl/aes.h"
  
  int main(int argc, char* argv[])
  {
      AES_KEY aesKey_;
      unsigned char userKey_[16];
      unsigned char in_[16];
      unsigned char out_[16];
      strcpy(userKey_,"0123456789123456");
      strcpy(in_,"0123456789123456");
  
      fprintf(stdout,"Original message: %s", in_);
      AES_set_encrypt_key(userKey_, 128, &amp;aesKey_);
      AES_encrypt(in_, out_, &amp;aesKey_);
  
      AES_set_decrypt_key(userKey_, 128, &amp;aesKey_);
      AES_decrypt(out_, in_,&amp;aesKey_);
      fprintf(stdout,"Recovered Original message: %s", in_);      
      return 0;
  }
  </code></pre>
  
  <p>I try to compile it using this command: </p>
  
  <pre class="lang-none prettyprint-override"><code>gcc -I/home/aleksei/openSSL0.9.8/include -o app -L . -lssl -lcrypto tema1.c
  </code></pre>
  
  <p>and I get this:</p>
  
  <pre class="lang-none prettyprint-override"><code> /tmp/ccT1XMid.o: In function `main':
   tema1.c:(.text+0x8d): undefined reference to `AES_set_encrypt_key'
   tema1.c:(.text+0xa7): undefined reference to `AES_encrypt'
   tema1.c:(.text+0xbf): undefined reference to `AES_set_decrypt_key'
   tema1.c:(.text+0xd9): undefined reference to `AES_decrypt'
   collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I am under Ubuntu 10.04. How can I get this to work ?</p>