2011-02-27 57 views
1

我编译libcurl中的mingw32的如下:编译libcurl中的mingw32的上(Windows)的Mac OS X 10.6

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

但编译使用的mingw32-gcc的程序时:

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

我得到:

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 

我敢肯定,错误是因为curl_socklen_t不存在于Windows上。我试过--target = - -mingw32但仍然没有成功。

请帮

末的配置为:

curl version: 7.21.4 Host setup: x86_64-apple-darwin10.6.0 Install prefix: /Users/daniel/mingw32
Compiler: gcc SSL support:
enabled (OpenSSL) SSH support:
no (--with-libssh2) zlib support: enabled krb4 support:
no (--with-krb4*) GSSAPI support: no (--with-gssapi)
SPNEGO support: no
(--with-spnego) TLS-SRP support: no (--enable-tls-srp) resolver:
default (--enable-ares/ --enable-threaded-resolver) ipv6 support: enabled IDN support:
no (--with-libidn) Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled Verbose errors: enabled (--disable-verbose)
SSPI support: no
(--enable-sspi) ca cert bundle: no ca cert path: no LDAP support:
enabled (OpenLDAP) LDAPS support:
enabled RTSP support: enabled
RTMP support: no
(--with-librtmp) Protocols:
DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP

+0

什么是您的配置输出?仅在最后,从''configure:'配置为构建curl/libcurl:'' – osgx 2011-02-27 23:25:38

+0

@osgx这一行,我也得到了sys/socket.h的检查...(缓存)是 终止行高于 – Daniel 2011-02-27 23:37:06

+0

@Daniel ,你的配置是为MacOS完成的,而不是为了mingw。 “--prefix”只设置安装目录,但configure对你的mingw编译器和环境一无所知。更新了答案。 – osgx 2011-02-27 23:50:02

回答

0

好像MinGW的没有sys/socket.h。刚刚检查我的新鲜mingw本机安装。

因此,您的应用程序不能移植到mingw(或配置运行错误)。可能是你应该在邮件列表中搜索或询问http://curl.haxx.se

感谢您的配置输出。你确实为MacOSX本身制造了卷曲,而不是为了mingw的交叉构建。你应该强制配置使用mingw的gcc,你也应该添加交叉编译选项(至少'--target'选项)。

+0

它的卷发源代码(tar.gz) 你能帮忙吗?我不知道该怎么办 – Daniel 2011-02-27 23:22:39

+0

http://www.allegro.cc/forums/thread/544463 – Daniel 2011-02-27 23:23:40