tags:

views:

71

answers:

2

Hi there I have a DLL project in VS08 and it references some code from lib32eay.dll(openssl). When I build the dLL it works fine on my machine since I have openssl installed. However my clients dont have openssl installed so they will get error running my app as it references the openssl dll. How do I build a DLL project so it can include all the needed stuff so I dont need to worry about clients not having some missing 3rd party libraries etc.??

A: 

You should statically link openssl inside your project. Use the statically linkable .lib files in your openssl lib folder and your problems will be gone

Henri
+1  A: 

One option which would not require lib32eay.dll to be present at all is to build it as a static library (.lib) instead of a shared library (.dll). Then you would link your own DLL against the static library, and clients will only have to worry about linking to your DLL.

cwick
hi i have tried this in the Properties page->Configuration Properties->Linker->Input->Additional Dependencies" I have set "C:\OpenSSL\lib\libeay32.lib C:\OpenSSL\lib\ssleay32.lib $(NOINHERIT)"This allows the static library from openssl to be linked so it can be compiled properly but how come it still complain about missing lib32eay.dll?
yhilbert
In Windows a .lib file can either be a static library or an import library for a DLL. Looks like you're linking against the import library instead of a static library. You have to either obtain a precompiled OpenSSL static library or else compile it yourself.
cwick
Hey thanks cwick I just found that is the case after having to recompile the openssl I realise there is a static version of lib32eay.lib and also a version for the DLL. The static version was 3MB while the one for the DLL was smaller at around 800Kb so I guess this is what you mean. I correctly pointed the additional dependencies to the bigger version and voila it builds and runs without the DLL.
yhilbert