go-curl icon indicating copy to clipboard operation
go-curl copied to clipboard

Windows: callback.go:8:10: fatal error: curl/curl.h: No such file or directory

Open BaseMax opened this issue 3 years ago • 2 comments
trafficstars

Hi there, I am trying to build/run our program on a Windows Laptop machine.

go run main.go provider.go

# github.com/andelf/go-curl
..\go\pkg\mod\github.com\andelf\[email protected]\callback.go:8:10: fatal error: curl/curl.h: No such file or directory
    8 | #include <curl/curl.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

go build .

# github.com/andelf/go-curl
..\go\pkg\mod\github.com\andelf\[email protected]\callback.go:8:10: fatal error: curl/curl.h: No such file or directory
    8 | #include <curl/curl.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

BaseMax avatar Sep 02 '22 08:09 BaseMax

Same error for me.

hkey0 avatar Sep 14 '23 18:09 hkey0

Hi. I'm just a user of go-curl, and I am not on Windows currently.. but try defining the ENV var CURL_GIT_PATH to be where-ever your source dir for CURL is located.

You might need to play with the path or path format some (add some prints to see what paths it's attempting). I don't remember much about how Windows and UNIX paths translate.

Worst case, I see in the code that IF CURL_GIT_PATH "is NOT" defined, then it will simply look for a curl directory just underneath go-curl (and then below, you see it looks in the curl-git-repo/include/curl). For this I'd probably just copy your curl repo into go-curl (then maybe remove the copied dir, afterwards)

target_dirs = [ '{}/include/curl'.format(CURL_GIT_PATH), '/usr/local/include', 'libdir/gcc/target/version/include' '/usr/target/include', '/usr/include', ]

sprive avatar Jul 07 '24 17:07 sprive