Jeremy Jeremy - 4 months ago 25
C Question

Cygwin: Libcurl Not Working

I can't seem to get libcurl to work. I've installed it with the cygwin package installer but when I run it in the cygwin bash shell with:

gcc -Wall -lcurl -g blah.c -o blah


It I get:


curl/curl.h: No such file or directory`,


then following errors that provoked by the
#include <curl/curl.h>
not working.

Answer
find / -name curl.h

if curl.h is found, compile with this:

-I/directory/that/contains_the_curl_header

but do not include 'curl.h', just the directory containing it. If you are doing it like this:

#include <curl/curl.h>

then only use the directory that contains the curl directory as the -I parameter.

man gcc for more info.