2012-07-17 143 views
0

我试图编译libcurl对于arm(am-1808),编译工作正常,但是当我尝试使用libcurl编译应用程序时,出现了一些错误,下面是我遵循的步骤:编译libcurl应用程序的错误

1.

./configure --host=arm-none-linux --build=i686-linux CFLAGS='-Os' --disable-ftp --disable-tftp --disable-ldap --disable-telnet --disable-dict --disable-ipv6 --disable-ares --disable-sspi --disable-cookies --disable-crypto-auth --without-libidn --without-ssl --without-zlib --without-libssh2 --without-gnutls --without-nss --without-ca-bundle --enable-smtp 

2.

make 

sudo make install 

一切正常了,到了这一步,但现在编译sample application我得到这些错误:

[email protected]:~/Desktop/smtp$ arm-none-linux-gnueabi-gcc -o email smtp-multi.c -lcurl 
smtp-multi.c:27:23: error: curl/curl.h: No such file or directory 
smtp-multi.c:77: error: return type is an incomplete type 
smtp-multi.c: In function 'tvnow': 
smtp-multi.c:81: error: storage size of 'now' isn't known 
smtp-multi.c:84: warning: 'return' with a value, in function returning void 
smtp-multi.c: At top level: 
smtp-multi.c:87: error: parameter 1 ('newer') has incomplete type 
smtp-multi.c:87: error: parameter 2 ('older') has incomplete type 
smtp-multi.c: In function 'main': 
smtp-multi.c:95: error: 'CURL' undeclared (first use in this function) 
smtp-multi.c:95: error: (Each undeclared identifier is reported only once 
smtp-multi.c:95: error: for each function it appears in.) 
smtp-multi.c:95: error: 'curl' undeclared (first use in this function) 
smtp-multi.c:96: error: 'CURLM' undeclared (first use in this function) 
smtp-multi.c:96: error: 'mcurl' undeclared (first use in this function) 
smtp-multi.c:98: error: storage size of 'mp_start' isn't known 
smtp-multi.c:105: error: 'CURL_GLOBAL_DEFAULT' undeclared (first use in this function) 
smtp-multi.c:115: warning: assignment makes pointer from integer without a cast 
smtp-multi.c:120: error: 'CURLOPT_URL' undeclared (first use in this function) 
smtp-multi.c:121: error: 'CURLOPT_USERNAME' undeclared (first use in this function) 
smtp-multi.c:122: error: 'CURLOPT_PASSWORD' undeclared (first use in this function) 
smtp-multi.c:123: error: 'CURLOPT_READFUNCTION' undeclared (first use in this function) 
smtp-multi.c:124: error: 'CURLOPT_MAIL_FROM' undeclared (first use in this function) 
smtp-multi.c:125: error: 'CURLOPT_MAIL_RCPT' undeclared (first use in this function) 
smtp-multi.c:126: error: 'CURLOPT_USE_SSL' undeclared (first use in this function) 
smtp-multi.c:126: error: 'CURLUSESSL_ALL' undeclared (first use in this function) 
smtp-multi.c:127: error: 'CURLOPT_SSL_VERIFYPEER' undeclared (first use in this function) 
smtp-multi.c:128: error: 'CURLOPT_SSL_VERIFYHOST' undeclared (first use in this  function) 
smtp-multi.c:129: error: 'CURLOPT_READDATA' undeclared (first use in this function) 
smtp-multi.c:130: error: 'CURLOPT_VERBOSE' undeclared (first use in this function) 
smtp-multi.c:131: error: 'CURLOPT_SSLVERSION' undeclared (first use in this function) 
smtp-multi.c:132: error: 'CURLOPT_SSL_SESSIONID_CACHE' undeclared (first use in this function) 
smtp-multi.c:142: error: storage size of 'timeout' isn't known 
smtp-multi.c:145: error: 'fd_set' undeclared (first use in this function) 
smtp-multi.c:145: error: expected ';' before 'fdread' 
smtp-multi.c:146: error: expected ';' before 'fdwrite' 
smtp-multi.c:147: error: expected ';' before 'fdexcep' 
smtp-multi.c:152: error: 'fdread' undeclared (first use in this function) 
smtp-multi.c:153: error: 'fdwrite' undeclared (first use in this function) 
smtp-multi.c:154: error: 'fdexcep' undeclared (first use in this function) 
smtp-multi.c:180: error: invalid use of void expression 
smtp-multi.c:180: error: type of formal parameter 1 is incomplete 
smtp-multi.c:180: error: type of formal parameter 2 is incomplete 
smtp-multi.c:181: warning: incompatible implicit declaration of built-in function 'fprintf' 
smtp-multi.c:181: error: 'stderr' undeclared (first use in this function) 

可能是我做错了什么的配置,而设置./configure,任何想法如何摆脱这些错误?

问候

乌萨马·本

回答

0

有没有在配置选项问题,--host选项是不正确的,对于--host是arm-NONE-Linux的gnueabi 所以正确配置正确的说法命令是(最好启用SSL)。

./configure --host=arm-none-linux-gnueabi --build=i686-linux CFLAGS='-Os' --disable-ftp --disable-tftp --disable-ldap --disable-telnet --disable-dict --disable-ipv6 --disable-ares --disable-sspi --disable-cookies --disable-crypto-auth --without-libidn --without-zlib --without-libssh2 --without-gnutls --without-nss --without-ca-bundle --with-ssl=PATH --enable-smtp 

注: 给路径OpenSSL的替代路径的--with-SSL