我只是从C ++开始,无法弄清楚如何添加库,特别是libcurl。我尝试了一堆教程,但大多数是2013/10或不起作用的。任何人都可以解释一下(最好用标准/非技术英语)来添加图书馆吗?我已经尝试在程序的包含部分和其他依赖项菜单中添加它。
请注意,这是我在3天前大约在3天前问的一个重新提出的问题,但我没有收到任何答复。不确定这是否很容易,我应该把它弄清楚,或者只是被埋葬在许多问题或其他原因中。无论如何,很抱歉重新定位。
I am just starting out in c++ and cannot figure out how to add libraries, in particular libcurl. I tried a bunch of tutorials but most were for 2013/10 or didn't work. Can anyone please explain (Preferably in standard/non technical English) how I can add the library? I have already tried adding it in the include section of the program and in the additional dependencies menu.
Note this is a re-post I asked virtually the same question around 3 days ago to which I received no replies. Not sure if that is because its very easy and I should have figured it out my self, or if it just got buried in a flood of questions, or some other reason. In any case sorry for the re-post.
发布评论
评论(1)
这是我如何与Visual Studio 2017合作的方式15.9.14:
%programData%\ Microsoft \ Windows \ Windows \ start Menu \ Program \ Program \ Visual Studio 2017 \ Visual Studio Tools \
)和<代码> cd toc:\ curl \ winbuild \
nmake/f makefile.vc mode = static
。这将构建卷曲作为静态库中的c:\ curl \ build \ libcurl-vc-x86-rease static-ipv6-sspi-winssl \
属性 - &gt; VC ++目录 - &GT;包括目录
添加c:\ curl \ build \ libcurl-vc-x86-rease static-ipv6-sspi-winssl \ incly
properties-properties-&gt; VC ++目录 - &GT; Library Directories
addc:\ curl \ build \ libcurl-vc-x86-rease static-ipv6-sspi-winssl \ lib \ lib \ lib \
在properties中 - &gt;链接器 - &gt;输入 - &gt;其他依赖关系
添加libcurl_a.lib
,ws2_32.lib
,crypt32.lib
,wldap32.lib
和strumaniz.lib
另外,您可以使用vcpkg安装curl:
%programData%\ Microsoft \ Windows \ Windows \ Start Menu \ Program \ Program \ Visual Studio 2017 \ Visual Studio Tools \
)和cd < to
c:\ vcpkg \
bootstrap-vcpkg.bat
vcpkg.exe Intertate Intertate intermate intermate
vcpkg.exe Extert interm curl
Here's how I've got curl to work with Visual Studio 2017 15.9.14:
C:\curl\
)Developer Command Prompt for VS 2017
(see Windows Start menu or%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\
) andcd
toC:\curl\winbuild\
nmake /f Makefile.vc mode=static
. This will build curl as a static library intoC:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\
Windows Console Application
)Properties -> VC++ Directories -> Include Directories
addC:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\include\
Properties -> VC++ Directories -> Library Directories
addC:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib\
thereProperties -> Linker -> Input -> Additional Dependencies
addlibcurl_a.lib
,Ws2_32.lib
,Crypt32.lib
,Wldap32.lib
andNormaliz.lib
Alternatively you can use vcpkg to install curl:
Developer Command Prompt for VS 2017
(see Windows Start menu or%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\
) andcd
toC:\vcpkg\
bootstrap-vcpkg.bat
vcpkg.exe integrate install
vcpkg.exe install curl