2011-02-27 56 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