title: Link error when using AES256 example with OpenSSL
body: <p>Using gcc 4.8.2 on Ubuntu 14.04 to compile openssl example.</p>
  
  
  
  <pre><code>gcc SSLsample.c -lssl3
  </code></pre>
  
  <p>The linker gives undefined symbols:</p>
  
  
  
  <pre><code>SSLsample.c:(.text+0x25d): undefined reference to `EVP_CIPHER_CTX_new'
  SSLsample.c:(.text+0x272): undefined reference to `EVP_aes_256_cbc'
  SSLsample.c:(.text+0x294): undefined reference to `EVP_DecryptInit_ex'
  SSLsample.c:(.text+0x2bc): undefined reference to `EVP_DecryptUpdate'
  SSLsample.c:(.text+0x2ed): undefined reference to `EVP_DecryptFinal_ex'
  SSLsample.c:(.text+0x309): undefined reference to `EVP_CIPHER_CTX_free'
  collect2: error: ld returned 1 exit status
  make: *** [sample] Error 1
  </code></pre>
  
  <p>There are many libraries under engines, but they are listed as alternate implementations, what is the main implementation?</p>
  
  <p>The suggestions to link with -lssl and -lcrypt sounded good, but look:</p>
  
  <pre><code>gcc SSLsample.c  -lssl -lcrypt
  /tmp/cczNovmQ.o: In function `main':
  SSLsample.c:(.text+0x4a): undefined reference to `ERR_load_crypto_strings'
  SSLsample.c:(.text+0x4f): undefined reference to `OPENSSL_add_all_algorithms_no\
  conf'
  SSLsample.c:(.text+0x59): undefined reference to `OPENSSL_config'
  SSLsample.c:(.text+0xc6): undefined reference to `BIO_dump_fp'
  SSLsample.c:(.text+0x12c): undefined reference to `EVP_cleanup'
  SSLsample.c:(.text+0x131): undefined reference to `ERR_free_strings'
  /tmp/cczNovmQ.o: In function `handleErrors':
  SSLsample.c:(.text+0x167): undefined reference to `ERR_print_errors_fp'
  /tmp/cczNovmQ.o: In function `encrypt':
  SSLsample.c:(.text+0x18c): undefined reference to `EVP_CIPHER_CTX_new'
  SSLsample.c:(.text+0x1a1): undefined reference to `EVP_aes_256_cbc'
  SSLsample.c:(.text+0x1c3): undefined reference to `EVP_EncryptInit_ex'
  SSLsample.c:(.text+0x1eb): undefined reference to `EVP_EncryptUpdate'
  SSLsample.c:(.text+0x21c): undefined reference to `EVP_EncryptFinal_ex'
  SSLsample.c:(.text+0x238): undefined reference to `EVP_CIPHER_CTX_free'
  /tmp/cczNovmQ.o: In function `decrypt':
  SSLsample.c:(.text+0x25d): undefined reference to `EVP_CIPHER_CTX_new'
  SSLsample.c:(.text+0x272): undefined reference to `EVP_aes_256_cbc'
  SSLsample.c:(.text+0x294): undefined reference to `EVP_DecryptInit_ex'
  SSLsample.c:(.text+0x2bc): undefined reference to `EVP_DecryptUpdate'
  SSLsample.c:(.text+0x2ed): undefined reference to `EVP_DecryptFinal_ex'
  SSLsample.c:(.text+0x309): undefined reference to `EVP_CIPHER_CTX_free'
  collect2: error: ld returned 1 exit status
  </code></pre>