본문 바로가기
개발 업무(코딩)-개발자였을때 썼던..

#include<curl/curl.h> 를 못 찾을 때

by 주용사 2023. 1. 8.
728x90

그냥 쉘에서는 curl이 사용이 되는데 코딩을 할려고하니 헤더파일을 못 찾는다.

yum install curl-devel

로 설치하자

설치하고 실행해보자

#include <curl/curl.h>
#include <stdio.h>

int main()
{
        CURL *curl;
        CURLcode res;

        curl = curl_easy_init();
        if(curl) {
                curl_easy_setopt(curl, CURLOPT_URL, "http://google.com");

                /* Perform the request, res will get the return code */
                res = curl_easy_perform(curl);
                /* Check for errors */
                if(res != CURLE_OK)
                        fprintf(stderr, "curl_easy_perform() failed: %s\n",
                                        curl_easy_strerror(res));

                /* always cleanup */
                curl_easy_cleanup(curl);
        }
        return 0;
}

https://stackoverflow.com/questions/11471690/curl-h-no-such-file-or-directory/11471743

728x90