基于嵌入式linux下的libcurl开发

    xiaoxiao2021-03-25  109

    1、ubuntu 交叉编译环境搭建:

    源码:curl-7.5.31.tar.gz (https://curl.haxx.se/download.html) 交叉编译环境:arm-none-linux-gnueabi- root@ubuntu:/home/topeet/source# tar -zxvf  curl-7.49.0.tar.gz root@ubuntu:/home/topeet/source# cd curl-7.49.0/ root@ubuntu:/home/topeet/source# ./configure --prefix=/usr/libcurl --host=arm-none-linux CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ root@ubuntu:/home/topeet/source# make root@ubuntu:/home/topeet/source# make install 生成成功 交叉编译后的文件在/usr/ libcurl目录下 root@ubuntu:/usr/libcurl# ls bin  include  lib  share libcurl头文件在include/curl目录 root@ubuntu:/usr/libcurl/include/curl# ls curlbuild.h  curlrules.h  easy.h     multi.h        typecheck-gcc.h curl.h       curlver.h    mprintf.h  stdcheaders.h 交叉编译后的动态库文件在lib目录 root@ubuntu:/usr/libcurl/lib# ls libcurl.a  libcurl.la  libcurl.so  libcurl.so.4  libcurl.so.4.4.0  pkgconfig

    /usr/libcurl/lib目录下的所有文件和pkgconfig目录都拷贝到ARM设备上文件系统的/lib目录,

    编译:arm-none-linux-gnueabi-g++ -lcurl -I/usr/libcurl/include -L/usr/libcurl/lib -o libcurl libcurl.c

    http://jingyan.baidu.com/article/647f0115cfed957f2148a806.html
    转载请注明原文地址: https://ju.6miu.com/read-8784.html

    最新回复(0)