andelf / go-curl

golang curl(libcurl) binding.
Apache License 2.0
485 stars 131 forks source link

help #12

Closed SETSESSION closed 9 years ago

SETSESSION commented 11 years ago

go get -u github.com/andelf/go-curl

github.com/andelf/go-curl

C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\core.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_getdate': E:\go\src\github.com\andelf\go-curl/core.go:41: undefined reference to_impcu rl_getdate' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\core.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_global_cleanup': E:\go\src\github.com\andelf\go-curl/core.go:50: undefined reference to_impcu rl_global_cleanup' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\core.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_global_init': E:\go\src\github.com\andelf\go-curl/core.go:60: undefined reference to_impcu rl_global_init' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\core.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_version': E:\go\src\github.com\andelf\go-curl/core.go:69: undefined reference to_impcu rl_version' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\core.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_version_info': E:\go\src\github.com\andelf\go-curl/core.go:79: undefined reference to_impcu rl_version_info' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_cleanup': E:\go\src\github.com\andelf\go-curl/easy.go:90: undefined reference to_imp__cu rl_easy_cleanup' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_duphandle': E:\go\src\github.com\andelf\go-curl/easy.go:100: undefined reference to_impc url_easy_duphandle' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_escape': E:\go\src\github.com\andelf\go-curl/easy.go:112: undefined reference to_impc url_easy_escape' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_getinfo_double': E:\go\src\github.com\andelf\go-curl/easy.go:32: undefined reference to_imp__cu rl_easy_getinfo' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_getinfo_long': E:\go\src\github.com\andelf\go-curl/easy.go:29: undefined reference to_impcu rl_easy_getinfo' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_getinfo_slist': E:\go\src\github.com\andelf\go-curl/easy.go:35: undefined reference to_impcu rl_easy_getinfo' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_getinfo_string': E:\go\src\github.com\andelf\go-curl/easy.go:26: undefined reference to_imp__cu rl_easy_getinfo' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_init': E:\go\src\github.com\andelf\go-curl/easy.go:169: undefined reference to_impc url_easy_init' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_pause': E:\go\src\github.com\andelf\go-curl/easy.go:180: undefined reference to_impc url_easy_pause' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_perform': E:\go\src\github.com\andelf\go-curl/easy.go:190: undefined reference to_imp__c url_easy_perform' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_recv': E:\go\src\github.com\andelf\go-curl/easy.go:203: undefined reference to_impc url_easy_recv' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_reset': E:\go\src\github.com\andelf\go-curl/easy.go:212: undefined reference to_impc url_easy_reset' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_send': E:\go\src\github.com\andelf\go-curl/easy.go:225: undefined reference to_imp__c url_easy_send' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_setopt_long': E:\go\src\github.com\andelf\go-curl/easy.go:10: undefined reference to_impcu rl_easy_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_setopt_off_t': E:\go\src\github.com\andelf\go-curl/easy.go:22: undefined reference to_impcu rl_easy_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_setopt_pointer': E:\go\src\github.com\andelf\go-curl/easy.go:19: undefined reference to_imp__cu rl_easy_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_setopt_slist': E:\go\src\github.com\andelf\go-curl/easy.go:16: undefined reference to_impcu rl_easy_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_easy_setopt_string': E:\go\src\github.com\andelf\go-curl/easy.go:13: undefined reference to_impcu rl_easy_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_strerror': E:\go\src\github.com\andelf\go-curl/easy.go:295: undefined reference to_imp__c url_easy_strerror' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_easy_unescape': E:\go\src\github.com\andelf\go-curl/easy.go:308: undefined reference to_impc url_easy_unescape' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_formadd_name_content_length': E:\go\src\github.com\andelf\go-curl/easy.go:40: undefined reference to_impcu rl_formadd' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_formadd_name_content_length_type': E:\go\src\github.com\andelf\go-curl/easy.go:47: undefined reference to_impcu rl_formadd' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function curl_formadd_name_file_type': E:\go\src\github.com\andelf\go-curl/easy.go:55: undefined reference to_impcu rl_formadd' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_free': E:\go\src\github.com\andelf\go-curl/easy.go:360: undefined reference to_impc url_free' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\easy.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_slist_append': E:\go\src\github.com\andelf\go-curl/easy.go:371: undefined reference to_impc url_slist_append' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_add_handle': E:\go\src\github.com\andelf\go-curl/multi.go:43: undefined reference to_impc url_multi_add_handle' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_cleanup': E:\go\src\github.com\andelf\go-curl/multi.go:53: undefined reference to_impc url_multi_cleanup' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_init': E:\go\src\github.com\andelf\go-curl/multi.go:62: undefined reference to_impc url_multi_init' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_perform': E:\go\src\github.com\andelf\go-curl/multi.go:73: undefined reference to_impc url_multi_perform' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_remove_handle': E:\go\src\github.com\andelf\go-curl/multi.go:84: undefined reference to_impc url_multi_remove_handle' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function curl_multi_setopt_long': E:\go\src\github.com\andelf\go-curl/multi.go:8: undefined reference to_impcu rl_multi_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function curl_multi_setopt_pointer': E:\go\src\github.com\andelf\go-curl/multi.go:11: undefined reference to_imp__c url_multi_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_strerror': E:\go\src\github.com\andelf\go-curl/multi.go:118: undefined reference to_imp curl_multi_strerror' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\multi.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_multi_timeout': E:\go\src\github.com\andelf\go-curl/multi.go:129: undefined reference to_imp curl_multi_timeout' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\share.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_share_cleanup': E:\go\src\github.com\andelf\go-curl/share.go:41: undefined reference to_imp__c url_share_cleanup' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\share.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_share_init': E:\go\src\github.com\andelf\go-curl/share.go:50: undefined reference to_impc url_share_init' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\share.cgo2.o: In function curl_share_setopt_long': E:\go\src\github.com\andelf\go-curl/share.go:7: undefined reference to_impcu rl_share_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\share.cgo2.o: In function curl_share_setopt_pointer': E:\go\src\github.com\andelf\go-curl/share.go:10: undefined reference to_imp__c url_share_setopt' C:\Users\think\AppData\Local\Temp\go-build789965335\github.com\andelf\go-curl_o bj\share.cgo2.o: In function cgo_99b504ba8303_Cfunc_curl_share_strerror': E:\go\src\github.com\andelf\go-curl/share.go:84: undefined reference to_impc url_share_strerror' collect2: ld returned 1 exit status

what is wrong?

andelf commented 11 years ago

compile error while linking to libcurl. have you installed libcurl ?

SETSESSION commented 11 years ago

目前是windows 386 + mingw

libcurl应该有,我看mingw 下有include/curl + lib 目录,里面有libcurl的东西

有如下疑问: 1。在mingw中直接输入go get -u github.com/andelf/go-curl的话,libcurl相关文件使用的是什么路径下的,是go安装目录的include吗?我需要把mingw/include/curl拷贝到go安装目录下吗? 2。如果重新编译curl,我下载了curl-7.30.0.tar.gz,使用mingw32-make -f Makefile.m32后,需要移动什么文件到什么位置吗?

问题有点多,呵呵

andelf commented 11 years ago

很久以前装过windows下,测试没问题就忽略了。 稍等我看下。如果有这个目录的话那应该只要link过去就ok

SETSESSION commented 11 years ago

非常感谢 :)

andelf commented 11 years ago

我这里ok的,你看下你的lib目录是不是有libcurl.a 或者 curl.lib 什么的

SETSESSION commented 11 years ago

您是指go目录下的还是Mingw下的,mingw libcurl.a libcurldll.a,libcurl.dll, 我将此3哥文件移动到go的目录下也不行 疯了

SETSESSION commented 11 years ago

您的windows是32位的吗,是否可以将您的本地的那几个文件和目录结构发给我,我再试试,地址:setcookie#163.com (#-》@)

llxwj commented 10 years ago

mingw的lib目录下有libcurl.dll.a,才能链接通过.另外使用静态链接的方法,包能正常生成,但是在main包调用后,还是有curl的函数无法链接,不知道为什么.

andelf commented 10 years ago

我这里暂时没有 MingW 环境, 麻烦你先测试下正常用 C 写的 libcurl 程序是否可以编译通过?

llxwj commented 9 years ago

BUILDING_LIBCURL这个宏要定义