c++ libcurl 编译混乱?

发布于 2024-12-13 22:20:01 字数 3278 浏览 0 评论 0原文

我正在尝试在 C++ 应用程序之一中使用 libcurl,我需要使用它从服务器下载文件。我为此使用 libcurl。但我在编译和链接它时遇到了困难。我编译了 libcurl 并只得到了 libcurl.lib 而没有 dll 文件。

这是错误。

1>------ Build started: Project: 34343, Configuration: Release Win32 ------
1>  34343.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C3699: '*' : cannot use this indirection on type 'IServiceProvider'
1>          compiler replacing '*' with '^' to continue parsing
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103): error C2371: 'IServiceProvider' : redefinition; different basic types
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(120): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(241): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(251): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6459): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6461): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I am trying to use libcurl in one of c++ application where I need to download a file from a server using this. I am using libcurl for this. But I am facing deficulties while compiling and linking it.I compiled libcurl and got only libcurl.lib and no dll file.

This is error.

1>------ Build started: Project: 34343, Configuration: Release Win32 ------
1>  34343.cpp
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(53) : System::IServiceProvider IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(96): error C3699: '*' : cannot use this indirection on type 'IServiceProvider'
1>          compiler replacing '*' with '^' to continue parsing
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103): error C2371: 'IServiceProvider' : redefinition; different basic types
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(53) : see declaration of 'IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(120): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(241): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(251): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6459): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
1>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\urlmon.h(6461): error C2872: 'IServiceProvider' : ambiguous symbol
1>          could be 'c:\program files (x86)\microsoft sdks\windows\v7.0a\include\servprov.h(103) : IServiceProvider'
1>          or       'c:\program files (x86)\reference assemblies\microsoft\framework\.netframework\v4.0\mscorlib.dll : System::IServiceProvider'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤君无依 2024-12-20 22:20:01

libcurl\src\ 中有一个 Visual Studio 项目。你在用它吗?这对我来说非常有用。

There is a visual studio project in libcurl\src\. Are you using it? It works great for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文