English 中文(简体)
Visual Studio merging DLL into console application
原标题:

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.

问题回答

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.

This isn t exactly what you re asking for, but you could just put the DLL file in the same folder as your compiled binary.

Unfortunately you cant include a dll in a .Net executable at this time using Visual Studio.
Some people have managed to solved this by using Mono instead.

Here are some links discussing it:

The problem is not related to the linker or Visual Studio. The problem is running the application. You must place the library libeay32.dll in a directory that is included in the PATH or in the same directory where the executable.

EDIT: Check Packing an exe + dll into one executable (not .NET)

HTH.





相关问题
How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Trouble with VS.PHP installing it s own Apache server

I tried installing VS.PHP some time ago. I was intent on seeing how it works with my current setup. I immediately encountered trouble: none of my sites wanted to render. On windows, I m using WAMP ...

Jquery and Intellisense in VS 2008 with hotfix and SP1

I followed Scott Guthrie s instructions as outlined at http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx but no avail: intellisense still doesn t work. Any tips?

Fixing "error C2065: undeclared identifier"

First off, I m completely out of my depth here. So the question might be the wrong one to ask, but here goes... As per the accepted answer to this question, I m trying to compile the bindings for the ...

View whitespace in VS2008

After Jeph most recent post: http://www.codinghorror.com/blog/archives/001310.html, I thought to myself it would be fun to see if any of my code has those trailing whitespaces. So I open Visual ...

热门标签