libcurl 사용하기
페이지 정보
작성자 서방님 댓글 0건 조회 92회 작성일 12-11-14 14:01본문
참조 링크:
http://oldpie.yoonkn.com/cgi-bin/moin.cgi/HttpDownloaderByLibcurl
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
- Connection Option
: CURLOPT_CONNECTTIMEOUT, CURLOPT_CONNECTTIMEOUT_MS
linux 환경
링크 1:
http://sanghun.tistory.com/197
windows 환경: VC++
링크2:
http://lyb1495.tistory.com/53
########### 리눅스 환경 ############
* cURL에 관한 개념 정리 및 예제
7. 결과물을 사용하여 열심히 코딩^^
# C코드
gcc -L/경로/lib/ -I/경로/include/ -o testprogram test.c -lcurl
# QT개발 환경
*.pro 파일에 라이브러리 사용을 위해 다음을 추가 한다.
INCLUDEPATH +=./ \
실제 사용하는 소스에서는 다음과 같이 include한다.
extern "C" {
#include <curl/curl.h>
}
##########################################################
http://oldpie.yoonkn.com/cgi-bin/moin.cgi/HttpDownloaderByLibcurl
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLoption option, parameter);
- Connection Option
: CURLOPT_CONNECTTIMEOUT, CURLOPT_CONNECTTIMEOUT_MS
linux 환경
링크 1:
http://sanghun.tistory.com/197
windows 환경: VC++
링크2:
http://lyb1495.tistory.com/53
########### 리눅스 환경 ############
POST 방식으로 보내는것 살펴보다가 cURL이라는걸 알게 되었는데 이거 뭐 만능이네요!
* libcurl 사용하기
1. 소스 다운로드
http://curl.haxx.se/download.html 에 위쪽에 Source Archives 중 적당한 파일 다운로드함.
2. 적당한 위치에 압축을 푼다.
3. ./Configure --prefix=/경로명
4. make
5. make install
6. 3번의 경로명 폴더에 가면 bin, include, lib, share폴더가 생성되어 있다.
7. 결과물을 사용하여 열심히 코딩^^
# C코드
test.c 파일에 #include <curl/curl.h> 되어 코딩되어 있다면 다음과 같이 컴파일 한다.
# QT개발 환경
*.pro 파일에 라이브러리 사용을 위해 다음을 추가 한다.
INCLUDEPATH +=./ \
./include/
LIBS = -L./lib \
-lcurl
실제 사용하는 소스에서는 다음과 같이 include한다.
extern "C" {
#include <curl/curl.h>
}
##########################################################
댓글목록
등록된 댓글이 없습니다.