Coder Social home page Coder Social logo

Comments (6)

wz2cool avatar wz2cool commented on September 22, 2024

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.

andelf avatar andelf commented on September 22, 2024

首先你需要一个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.

wz2cool avatar wz2cool commented on September 22, 2024

大哥谢谢 好像没那个错了 但是开始报其他错,我这个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.

andelf avatar andelf commented on September 22, 2024

这个是链接错误,一般是找不到lib导致的,你看看你的对应lib文件在不再

from go-curl.

wz2cool avatar wz2cool commented on September 22, 2024

大神 我终于折腾好了 我说一下咋弄的,你帮忙看看

  1. 我先去自己编译了一下 libcurl , 参考http://blog.mcxiaoke.com/2010/12/12/compile-and-use-libcurl-in-mingw-win32-how-to/
  2. 我修改了源码,添加了两行 在 core.go 中
    #cgo CFLAGS: -I. -Ic:/curllib/include -g -O2 -DCURL_STATICLIB -c
    #cgo LDFLAGS: -Lc:/curllib/lib -lcurl -lwldap32 -lws2_32
  3. 遇到了已经存在的问题,解决方法是注释掉, 参考 #30
  4. 我发现运行examples 中的 simple.go 还是报错 我发现是其他example 导致的, 于是我删除了其他例子只保留 simple.go

终于编译成功了。。。。

from go-curl.

andelf avatar andelf commented on September 22, 2024

@wz2cool 现在看起来有点问题就是 win32不能支持 multi.go 。手头没环境不能整。。

from go-curl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.