c语言的curl 编程
[Linux@centos-64-min exercise]# gcc -Wall -o curltest curltest.c
/tmp/ccosVANi.o: In function `main':
curltest.c:(.text+0x2a): undefined reference to `curl_easy_init'
curltest.c:(.text+0x53): undefined reference to `curl_easy_setopt'
curltest.c:(.text+0x5c): undefined reference to `curl_easy_perform'
curltest.c:(.text+0x68): undefined reference to `curl_easy_cleanup'
collect2: ld returned 1 exit status
原因:编译器找不到curl库文件
解决办法:确定安装库后, gcc -Wall -o curltest curltest.c -l curl
安装curl
1、进入压缩包所在目录
# cd /root/soft
2、解压缩安装包
# tar -zxf curl-7.42.1.tar.gz
3、进入解压后的安装包目录
# cd curl-7.42.1
4、配置
# ./configure --prefix=/usr/local/curl
5、安装
# make; make install