将静态库(.lib 文件)捆绑到 dll 中 [英] Bundle a static library(.lib file) into dll

查看:55
本文介绍了将静态库(.lib 文件)捆绑到 dll 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个 dll 项目.我正在使用 openssl 和 quickfix 库.我不希望用户在使用 dll 时单独复制库.我也想将这些 .lib 文件捆绑到我的 dll 中.

I am building a dll project. I am using openssl and quickfix libraries. I don't want users to separately copy the libraries when they use dll. I want to bundle these .lib files into my dll as well.

我正在使用视觉工作室.如何将这些库(.lib 静态库)捆绑到我的 dll 中,以便用户可以将我的 dll 复制到他们的项目中并立即开始工作.

I am using visual studio. How can I bundle these libraries(.lib static libraries) into my dll so that the user can just copy my dll into their projects and start working right away.

谢谢,

推荐答案

默认是绑定的.你的程序,就叫MyProgram.DLL,就可以了

by default it'll be bunded in. you program, just call it MyProgram.DLL, can

  1. 调用其他程序,如 DLL 文件,例如C 运行时库提供MSVCRT.DLL 供 MyProgram.DLL 调用;或
  2. 在您的二进制文件中包含其他程序的静态库文件,即 .LIB 文件,即 MyProgram.DLL,例如C 运行时库为 MyProgram.DLL 提供 LIBCMT.LIB 以包含在内部和调用.

似乎您想要选项 2),但实际上,由于提供的是 .LIB 文件,选项 1) 对您来说是不可能的.

It seems you want option 2), but actually, since what provided are .LIB files, option 1) is not possible for you.

这篇关于将静态库(.lib 文件)捆绑到 dll 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆