C++:需要从 dll 发出 HTTP 请求 - 我从哪里开始?
我尝试过使用curlib,但发现我的dll变得依赖于curlib.dll。我可以研究和使用其他方法吗?我只是想向网页发出请求。我的 dll 必须是独立的,以便它可以单独分发。
谢谢
I've tried using curllib, but find my dll becomes dependent on curllib.dll. Is there another method I can investigate and use? I simply want to make a request to a web page. My dll has to be independant so it can be distributed on its own.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
libcurl 库既作为 DLL 又作为静态库 - 如果您不想依赖于 DLL,请与静态库链接 - 它称为 libcurl.a,可以在 libcurl Windows 发行版的 lib 目录中找到。请注意,您可能还需要显式链接此目录中的部分或全部其他库,具体取决于您的代码实际执行的操作。
The libcurl library comes as both a DLL and as a static library - if you don't want dependencies on the DLL, link with the static library - it's called libcurl.a, and can be found in the lib directory of the libcurl Windows distribution. Note that you may also need to explicitly link against some or all of the other libraries in this directory, depending on what your code actually does.
对于任何处于类似情况的人,我设法在最新的curl发行版中编译libcurl Visual Studio项目,并将运行时库设置为多线程dll。我想除了输出文件之外,其他所有内容都保持不变(请注意调试/发布)。一旦用我的 dll 编译了 lib,我注意到现在我的 dll 仅依赖于其他 3 个 dll。
我现在担心它是一个 Win7 64 位问题。至少我让我的 dll 在没有 libcurl 依赖的情况下工作, 正确的!?
For anyone in a similar situation I managed to compile the libcurl visual studio project in the latest curl distribution with Runtime library set to Multi-threaded dll. I think I left everything else the same apart from the output files (debug/release respectfully). Once the lib compiled with my dll I noticed now my dll is only dependant on 3 other dlls.
I fear now its a Win7 64 bit issue. At least I got my dll working with no libcurl dependency, right!?