简体   繁体   English

在Mac OS X 10.6上为Mingw32(Windows)编译libcurl

[英]Compiling libcurl for mingw32 (Windows) on mac os x 10.6

I'm compiling libcurl for mingw32 as follows: 我正在为mingw32编译libcurl,如下所示:

./configure --prefix=/Users/daniel/mingw32 "CFLAGS= -ABI=32"
make
make install

But when compiling a program using mingw32-gcc: 但是当使用mingw32-gcc编译程序时:

i386-mingw32-gcc -lcurl -o bin/remote-win.exe remote.c

i get: 我得到:

In file included from /Users/daniel/mingw32/usr/local/include/curl/curl.h:34,
                 from remote.c:6:
/Users/daniel/mingw32/usr/local/include/curl/curlbuild.h:152:26: sys/socket.h: No such file or directory
In file included from /Users/daniel/mingw32/usr/local/include/curl/curl.h:34,
                 from remote.c:6:
/Users/daniel/mingw32/usr/local/include/curl/curlbuild.h:165: error: syntax error before "curl_socklen_t"
In file included from /Users/daniel/mingw32/usr/local/include/curl/curl.h:35,
                 from remote.c:6:
/Users/daniel/mingw32/usr/local/include/curl/curlrules.h:143: error: size of array `__curl_rule_01__' is negative
/Users/daniel/mingw32/usr/local/include/curl/curlrules.h:153: error: size of array `__curl_rule_02__' is negative

I'm pretty sure the error is because curl_socklen_t does not exist on windows. 我很确定错误是因为在Windows上不存在curl_socklen_t。 I've tried --target= - -mingw32 but still no success. 我尝试了--target = -- mingw32,但仍然没有成功。

Please help 请帮忙

End of configured for: 结束配置为:

curl version: 7.21.4 Host setup: x86_64-apple-darwin10.6.0 Install prefix: /Users/daniel/mingw32 curl版本:7.21.4主机设置:x86_64-apple-darwin10.6.0安装前缀:/ Users / daniel / mingw32
Compiler: gcc SSL support: 编译器:gcc SSL支持:
enabled (OpenSSL) SSH support: 已启用(OpenSSL)SSH支持:
no (--with-libssh2) zlib support: enabled krb4 support: 否(--with-libssh2)zlib支持:已启用krb4支持:
no (--with-krb4*) GSSAPI support: no (--with-gssapi) 否(--with-krb4 *)GSSAPI支持:否(--with-gssapi)
SPNEGO support: no SPNEGO支持:否
(--with-spnego) TLS-SRP support: no (--enable-tls-srp) resolver: (--with-spnego)TLS-SRP支持:否(--enable-tls-srp)解析器:
default (--enable-ares / --enable-threaded-resolver) ipv6 support: enabled IDN support: 缺省(--enable-ares / --enable-threaded-resolver)ipv6支持:已启用IDN支持:
no (--with-libidn) Build libcurl: Shared=yes, Static=yes 否(--with-libidn)构建libcurl:共享=是,静态=是
Built-in manual: enabled Verbose errors: enabled (--disable-verbose) 内置手册:已启用详细错误:已启用(--disable-verbose)
SSPI support: no SSPI支持:否
(--enable-sspi) ca cert bundle: no ca cert path: no LDAP support: (--enable-sspi)ca证书包:无ca证书路径:无LDAP支持:
enabled (OpenLDAP) LDAPS support: 已启用(OpenLDAP)LDAPS支持:
enabled RTSP support: enabled 启用RTSP支持:启用
RTMP support: no RTMP支持:否
(--with-librtmp) Protocols: (--with-librtmp)协议:
DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP DICT文件FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP

Seems like mingw have no sys/socket.h . 好像mingw没有sys/socket.h Just checked on my fresh mingw native install. 刚刚检查了我最新的mingw本机安装。

So, your application is not portable to mingw (or configure run was wrong). 因此,您的应用程序无法移植到mingw(或配置运行错误)。 May be you should search or ask in Mailing List at http://curl.haxx.se 可能是您应该在http://curl.haxx.se的邮件列表中搜索或询问

Thanks for your configure output. 感谢您的配置输出。 You did configed the curl for MacOSX itself, not for a cross-build for mingw. 您确实为MacOSX本身配置了curl,而不是为mingw进行交叉构建。 Your should force configure to use mingw's gcc, also you should to add cross-compilation options (at least '--target' option). 您应该强制配置为使用mingw的gcc,还应该添加交叉编译选项(至少是“ --target”选项)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM