简体   繁体   English

如何将程序中使用的所有共享库更改为Windows中的静态库?

[英]How do I change all shared libraries used in my programe to static libraries in windows?

The shared library is causing much trouble for me, and disk space is far less expensive than the trouble itself. 共享库给我造成了很多麻烦,并且磁盘空间比麻烦本身便宜得多。

How can I convert all shared libs( .dll ) to static libs( .lib ) and make my programe use them instead of using shared libs? 如何将所有共享库( .dll )转换为静态库( .lib ),并使我的程序使用它们而不是共享库?

Note some .dll s are not directly refered to by my programe,eg my programe requires libpng ,and libpng requires zlib.dll . 请注意 ,我的程序未直接引用某些.dll ,例如,我的程序需要libpng ,而libpng需要zlib.dll

Is there a solution that wraps up all these cases? 是否有解决所有这些情况的解决方案?

You cannot convert a shared library (dll) to a static library (lib). 您不能将共享库(dll)转换为静态库(lib)。 The dll contains headers, exports, and such things that make it completely impossible to do. 该dll包含标头,导出等使之完全不可能执行的操作。

If you have access to the source, you can usually recompile it as a static library. 如果您有权访问源,通常可以将其重新编译为静态库。 Otherwise, you will have to get your hands on the static library yourself. 否则,您将必须亲自使用静态库。

There is no practical way to convert DLLs to static libraries. 没有实用的方法将DLL转换为静态库。 You will either need to find the actual static libraries, or you will need to build them from source. 您将需要找到实际的静态库,或者需要从源代码构建它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM