【发布时间】:2015-12-21 08:42:23
【问题描述】:
我并不完全理解 libcURL 的手册/帮助。我正在尝试构建一个包含 libcURL 库的交叉编译器。我在这个video 的帮助下在我的服务器上安装了一个交叉编译器,并且可以用arm-linux-gnueabihf-gcc hello_simple.c 启动它。我可以编译像printf ("Hello World"); 这样的简单c 代码之后我尝试安装libcURL 并阅读我需要编译lib 并使用configure 文件来设置构建和主机。我使用了不同的配置,例如:sudo ./configure --build=i586-pc-linux-gnu --host=arm-linux --target=arm-linux --prefix=/home/nevadmin/dev/gcc,但都没有工作。我想我在某个地方犯了错误。这是配置完成后的输出:
curl version: 7.46.0
Host setup: arm-unknown-linux-gnu
Install prefix: /home/nevadmin/dev/gcc
Compiler: gcc
SSL support: no (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )
SSH support: no (--with-libssh2)
zlib support: no (--with-zlib)
GSS-API support: no (--with-gssapi)
TLS-SRP support: no (--enable-tls-srp)
resolver: default (--enable-ares / --enable-threaded-resolver)
IPv6 support: no (--enable-ipv6)
Unix sockets support: enabled
IDN support: no (--with-{libidn,winidn})
Build libcurl: Shared=yes, Static=yes
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: no
ca cert path: no
LDAP support: no (--enable-ldap / --with-ldap-lib / --with-lber-lib)
LDAPS support: no (--enable-ldaps)
RTSP support: enabled
RTMP support: no (--with-librtmp)
metalink support: no (--with-libmetalink)
PSL support: no (libpsl not found)
HTTP2 support: disabled (--with-nghttp2)
Protocols: DICT FILE FTP GOPHER HTTP IMAP POP3 RTSP SMTP TELNET TFTP
我的服务器 cpuinfo:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5649 @ 2.53GHz
stepping : 2
microcode : 0x15
cpu MHz : 2533.423
cache size : 12288 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss ht syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat dtherm
bogomips : 5066.84
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
还有我的控制器:
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 298.80
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2
使用例如gcc hello_world.c -o hello_world 它为AMD处理器架构而不是ARM编译它。看来我错过了指向 libcURL 库的链接?我感谢每一个帮助。对不起,我的英语不是我的母语。
与L/home/nevadmin/dev/gcc -lcurl 的链接正在工作,我可以使用 libcURL 编译 c 代码,但它仍然为 amd64 而不是 arm 编译它。 :/
【问题讨论】:
-
仅供参考:已经看过Buildroot?它已经提供了 libcurl 配方,它将为您处理大部分交叉编译任务。
标签: c linux gcc cross-compiling libcurl