Convert a dll to a lib for static linking?
Is there a free way to statically link a dll? I've tried dll to lib but $999 is too expensive. What are alternatives since I want to have 1 nice exe in开发者_如何学Cstead of 1 exe + 1 DLL.
Thanks
I'm not certain it can even be done. There are some issues that would need to be treated very delicately.
- Resources in the DLL? LIB files wouldn't hold those, so you'd have to export them as well and then reintegrate them into the final EXE
- Who calls DLLMain, and when?
Lou Franco's idea would skirt all of those issues, but it would be important to make sure you don't leave the unpacked DLLs laying around on your user's drive.
You could put the dll in your resources and then write it out and load it dynamically. You'll have to use delay-loading and make sure to write it out before you call anything in it.
It's not really linked this way, but you only have to deploy an .exe.
In many cases you can load a dll directly from a resource, into memory using this cool library: https://github.com/fancycode/MemoryModule.
It isn't exactly what you are looking for, but it will accomplish the same end goal.
Im search in the internet and finde this softwares,I dont test;
http://www.coderupgrade.com/Dll2StaticLib.exe
http://www.binary-soft.com/dll2lib/d2l.exe
精彩评论