编译arm的libcurl应用程序时出错

时间:2012-07-17 16:01:11

标签: linux arm

我正在尝试为arm(libcurl)编译am-1808,编译工作正常但是当我尝试使用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

第3

sudo make install

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

usama@ubuntu:~/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时可能是我在配置上做错了什么,任何想法我怎么能摆脱这些错误?

问候

乌萨马

1 个答案:

答案 0 :(得分:0)

配置选项出现问题, - host选项不正确,--host的正确参数是arm-none-linux-gnueabi 所以正确的configure命令是(最好启用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

注意: 在--with-ssl

中给OpenSSL路径代替PATH