Comments (6)
I use Windows platform to develop not linux. so my problem is how to install curl in Windows and use it in golang
from go-curl.
首先你需要一个MingW/gcc环境,保证你的cgo可以正常工作。
我找到了一份教程 http://itekblog.com/windows-go/#Installingmingw
然后在 curl 页面下载curl的开发binary
https://curl.haxx.se/download.html
Win64 - MinGW64 一栏。放到MingW对应目录,lib include
from go-curl.
大哥谢谢 好像没那个错了 但是开始报其他错,我这个curl 版本比你那个高,我找不到你那个7.22 版本的不知道是不是对应不上,我是小白
C:\Users\Frank\AppData\Local\Temp\go-build560987318\github.com\andelf\go-curl_obj\core.cgo2.o: In function cgo_1aa5c582df5b_Cfunc_curl_getdate': E:/workspace/git/go/src/github.com/andelf/go-curl/core.go:47: undefined reference to
_imp__curl_getdate'
from go-curl.
这个是链接错误,一般是找不到lib导致的,你看看你的对应lib文件在不再
from go-curl.
大神 我终于折腾好了 我说一下咋弄的,你帮忙看看
- 我先去自己编译了一下 libcurl , 参考http://blog.mcxiaoke.com/2010/12/12/compile-and-use-libcurl-in-mingw-win32-how-to/
- 我修改了源码,添加了两行 在 core.go 中
#cgo CFLAGS: -I. -Ic:/curllib/include -g -O2 -DCURL_STATICLIB -c
#cgo LDFLAGS: -Lc:/curllib/lib -lcurl -lwldap32 -lws2_32 - 遇到了已经存在的问题,解决方法是注释掉, 参考 #30
- 我发现运行examples 中的 simple.go 还是报错 我发现是其他example 导致的, 于是我删除了其他例子只保留 simple.go
终于编译成功了。。。。
from go-curl.
@wz2cool 现在看起来有点问题就是 win32不能支持 multi.go 。手头没环境不能整。。
from go-curl.
Related Issues (20)
- Perform() hangs when passing in false to WRITEFUNCTION HOT 10
- Issues when passing in multiple values to the OPT_HTTPHEADER HOT 2
- How store all Cookies in a file? HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference
- 请求curl返回的各项时间为 0 HOT 1
- is curl_global_init handled safely? is the library thread-safe? HOT 6
- Couldn't read Getinfo Informations
- use C.struct, not _Ctype_struct
- Cannot compile after march 14 update HOT 9
- cannot find the PUT and GET method implementation
- Is there functionality for running the requests through torsockets?
- how to know the compiled in libcurl version?
- HTTP2 support?
- Get cURL error code HOT 1
- Problem in building go software for windows HOT 4
- Getting SSL certificate expiry date
- Windows: callback.go:8:10: fatal error: curl/curl.h: No such file or directory HOT 2
- curl 7.56 deprecations
- library not supporting curl version 8.0.X or higher HOT 1
- Not building at Docker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-curl.