我編譯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
什麼是您的配置輸出?僅在最後,從''configure:'配置爲構建curl/libcurl:'' – osgx 2011-02-27 23:25:38
@osgx這一行,我也得到了sys/socket.h的檢查...(緩存)是 終止行高於 – Daniel 2011-02-27 23:37:06
@Daniel ,你的配置是爲MacOS完成的,而不是爲了mingw。 「--prefix」只設置安裝目錄,但configure對你的mingw編譯器和環境一無所知。更新了答案。 – osgx 2011-02-27 23:50:02