简体   繁体   English

如何在 Visual Studio 中使用 cURLpp?

[英]How do I use cURLpp with Visual Studio?

I'm using VS 2019, have downloaded all the cURLpp headers, put them and the cURL headers in an include folder and added this include directory under Project Properties -> Additional Include Directories.我正在使用 VS 2019,已下载所有 cURLpp 标头,将它们和 cURL 标头放在包含文件夹中,并在项目属性 -> 附加包含目录下添加此包含目录。 When I try to build example00.cpp from the cURLpp site, I get errors saying I have an unresolved external symbol.当我尝试从 cURLpp 站点构建 example00.cpp 时,我收到错误消息,说我有一个未解析的外部符号。 I've never used a third party library with C++ before, so please explain like I'm an idiot.我以前从未在 C++ 中使用过第三方库,所以请像我是个白痴一样解释一下。 Should I have a dll or lib file?我应该有一个 dll 或 lib 文件吗?

I use vcpkg to install curlpp , and I find that my project configuration in visual studio is x64 , if I use x86 curlpp it will get build error, I need to use x64 curlpp then build sucess.我使用 vcpkg 安装curlpp ,我发现我在 Visual Studio 中的项目配置是x64 ,如果我使用x86 curlpp它会出现构建错误,我需要使用x64 curlpp然后构建成功。

This is the include step:这是包含步骤:

  1. Run cmd command: vcpkg install curlpp:x64-windows运行cmd命令: vcpkg install curlpp:x64-windows
  2. goto Project > Configuration Properties -> Linker -> General -> Additional Library Directories, add yourVcpkgFolderPath\\vcpkg\\installed\\x64-windows\\lib\\转到 Project > Configuration Properties -> Linker -> General -> Additional Library Directories,添加yourVcpkgFolderPath\\vcpkg\\installed\\x64-windows\\lib\\
  3. goto Project > Configuration Properties -> Linker -> Input -> Additional Dependencies, add curlpp.lib转到 Project > Configuration Properties -> Linker -> Input -> Additional Dependencies,添加curlpp.lib

Then build the project, it should build success.然后构建项目,它应该构建成功。

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

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