c++ libcurl 编译混乱?
我正在尝试在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
libcurl\src\
中有一个 Visual Studio 项目。你在用它吗?这对我来说非常有用。There is a visual studio project in
libcurl\src\
. Are you using it? It works great for me.