---
title: "使用CURL库在编译时遇到的问题"
author: "CharlesCui"
date: "2010-12-29T18:49:06Z"
tags: []
categories: ["编程语言"]
slug: "curl"
draft: false
lastmod: "2010-12-29T18:49:22Z"
id: 855139
url: "https://charlescui.iteye.com/blog/855139"
---

- 表现：

 

windows平台，使用libcurl，编译（link阶段）时遇到：

VS报错 

error LNK2001: unresolved external symbol \_\_imp\_\_curl\_easy\_perform  
error LNK2001: unresolved external symbol \_\_imp\_\_curl\_easy\_setopt  
error LNK2001: unresolved external symbol \_\_imp\_\_curl\_easy\_init  
error LNK2001: unresolved external symbol \_\_imp\_\_curl\_easy\_cleanup

  

- 解决方法：

项目属性-&gt;link-&gt;input:

libcurl.lib ws2\_32.lib winmm.lib wldap32.lib

 

项目属性-&gt;C/C++-&gt;Preprocessor-&gt;Definitions 增加:

 

BUILDING\_LIBCURL

HTTP\_ONLY