如何在 Visual Studio 中使用 cURLpp? [英] How do I use cURLpp with Visual Studio?
问题描述
我正在使用 VS 2019,已下载所有 cURLpp 标头,将它们和 cURL 标头放在包含文件夹中,并在项目属性 -> 附加包含目录下添加了此包含目录.当我尝试从 cURLpp 站点构建 example00.cpp 时,我收到错误消息,说我有一个未解析的外部符号.我以前从未在 C++ 中使用过第三方库,所以请像我是个白痴一样解释一下.我应该有一个 dll 或 lib 文件吗?
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. When I try to build example00.cpp from the cURLpp site, I get errors saying I have an unresolved external symbol. I've never used a third party library with C++ before, so please explain like I'm an idiot. Should I have a dll or lib file?
推荐答案
我用vcpkg安装curlpp
,发现我在visual studio中的项目配置是x64
,如果我使用 x86 curlpp
它会得到构建错误,我需要使用 x64 curlpp
然后构建成功.
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.
这是包含步骤:
- 运行cmd命令:
vcpkg install curlpp:x64-windows
- 转到项目>配置属性 ->链接器 ->一般 ->其他库目录,添加
yourVcpkgFolderPath\vcpkg\installed\x64-windows\lib\
- 转到项目>配置属性 ->链接器 ->输入 ->附加依赖项,添加
curlpp.lib
然后构建项目,它应该构建成功.
Then build the project, it should build success.
这篇关于如何在 Visual Studio 中使用 cURLpp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!