title: Static linking OpenSSL and cURL with Autotools and MinGW
body: <p>I'm trying to build a statically linked OpenSSL + LibCurl console application with CodeBlocks. However, I can't get it to work. I keep getting these errors:</p>
  
  <pre><code>||=== Build: Debug in Filer (compiler: GNU GCC Compiler) ===|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_get0_alpn_selected'|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_CTX_set_alpn_protos'|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_CTX_set_next_proto_select_cb'|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_CTX_set_srp_username'|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_CTX_set_srp_password'|
  C:\MinGW\msys\1.0\local\lib\libcurl.a(libcurl_la-openssl.o)|| undefined reference to `SSL_COMP_free_compression_methods'|
  ||=== Build failed: 6 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
  </code></pre>
  
  <p>This is the build log:</p>
  
  <pre><code>mingw32-g++.exe  -o bin\Debug\Filer.exe "obj\Debug\MinGW Sources\BASE64\base64.o
  " "obj\Debug\MinGW Sources\SQLite\sqlite3.o" obj\Debug\Users\thoma\Desktop\Filer
  \main.o  -static  -lcurl -lrtmp -lidn -lssl -lssh2 -lcrypto -lz -lwldap32 -lws2_
  32 -lwinmm -lgdi32 C:\MinGW\msys\1.0\local\lib\libcrypto.dll.a C:\MinGW\msys\1.0
  \local\lib\libcurl.a C:\MinGW\msys\1.0\local\lib\libcurl.dll.a C:\MinGW\msys\1.0
  \local\lib\libssl.a C:\MinGW\msys\1.0\local\lib\libssl.dll.a C:\MinGW\msys\1.0\l
  ocal\lib\libwxjpeg-3.0.a C:\MinGW\msys\1.0\local\lib\libwxpng-3.0.a C:\MinGW\msy
  s\1.0\local\lib\libwxscintilla-3.0.a C:\MinGW\msys\1.0\local\lib\libwxtiff-3.0.a
   C:\MinGW\msys\1.0\local\lib\libz.a C:\MinGW\msys\1.0\local\lib\libz.dll.a
  </code></pre>
  
  <p>I have used the set-up which is outlined <a href="https://stackoverflow.com/questions/6243638/adding-static-libcurl-to-codeblocks-ide">here</a>.</p>
  
  <p>Some pictures of my setup:</p>
  
  <p><a href="https://i.stack.imgur.com/3zaTD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3zaTD.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/ghGVN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ghGVN.png" alt="enter image description here"></a> <a href="https://i.stack.imgur.com/tutgG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tutgG.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/FRWzY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FRWzY.png" alt="enter image description here"></a><a href="https://i.stack.imgur.com/R9ikZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R9ikZ.png" alt="enter image description here"></a></p>