R – Visual Studio merging DLL into console application

linkeropensslvisual-studio-2008

I have very simple program to simplify things as shown below…

#include <openssl/evp.h>
int main (int argc, char *argv[])
{
        EVP_CIPHER_CTX ctx;
        EVP_CIPHER_CTX_init(&ctx);
}

It references 1 function in a DLL(libeay32.dll from openSSL). I build it with settings "Linker->Input->Additional Dependencies->" pointing to where the libeay32.lib is stored. However when you run it will complain with "This application has failed to start because LIBEAY32.DLL was not found". I want to build it so I can have this DLL built into the executable so it doesn't need to look for it on client machines.

If you can assist can you please explain it in small baby steps so I can understand as I'm a beginner to Visual Studio.

Best Answer

What you're asking is to link statically to your executable.

Here's a guide on how to get OpenSSL to compile to a static library on various platforms.

Related Topic