curl.h no such file or directory

后端 未结 5 2056
抹茶落季
抹茶落季 2021-01-30 06:38

I installed curl this command (i use Ubuntu):

sudo apt-get install curl

When I test simple program using g++ test.cpp



        
5条回答
  •  再見小時候
    2021-01-30 07:00

    To those who use centos and have stumbled upon this post :

     $ yum install curl-devel
    

    and when compiling your program example.cpp, link to the curl library:

     $ g++ example.cpp -lcurl -o example
    

    "-o example" creates the executable example instead of the default a.out.

    The next line runs example:

     $ ./example
    

提交回复
热议问题