当前位置: 首页 > 工具软件 > OSSC > 使用案例 >

Ali oss c sdk交叉编译

令狐昂雄
2023-12-01

sdk自带readme描述很详细了, 直接进入正题。

下载编译curl,  apt-get source curl      // ./configure --host=arm --prefix=/work/mynfs/open_source/oss_prefix CC=arm-himix200-linux-gcc --enable-shared

make&&make install

下载编译apr   https://apr.apache.org/download.cgi     ./configure --prefix=/work/mynfs/open_source/oss_prefix --host=arm-linux CC=arm-himix200-linux-gcc CXX=arm-himix200-linux-g++ LD=arm-himix200-linux-ld ac_cv_file__dev_zero=yes ac_cv_func_setpgrp_void=yes apr_cv_tcp_nodelay_with_cork=yes --cache=arm-linux.cache --without-libtool

make&&make install

 

下载编译apr-util   https://apr.apache.org/download.cgi     ./configure --host=arm --prefix=/work/mynfs/open_source/oss_prefix CC=arm-himix200-linux-gcc

make&&make install

 

下载编译expat  git clone https://github.com/libexpat/libexpat.git

./buildconf.sh

./configure --host=arm --prefix=/work/mynfs/open_source/oss_prefix CC=arm-himix200-linux-gcc

make&&make install

 

下载编译 mxml   https://github.com/michaelrsweet/mxml/releases/tag/v2.12

./configure --host=arm --prefix=/work/mynfs/open_source/oss_prefix CC=arm-himix200-linux-gcc 

make&&make install

 

mxml v3.1的有问题,就没下载了。

 

cmake编译

cmake  .  -DCURL_INCLUDE_DIR=/work/mynfs/open_source/oss_prefix/include/curl/ -DCURL_LIBRARY=/work/mynfs/open_source/oss_prefix/lib/libcurl.so -DMATH_LIBRARY=/work_dv300/arm-himix/arm-himix200-linux/target/usr/lib/libm.so -DPTHREAD_LIBRARY=/work_dv300/arm-himix/arm-himix200-linux/target/usr/lib/libpthread.so -DAPR_INCLUDE_DIR=/work/mynfs/open_source/oss_prefix/include/apr-1/ -DAPR_LIBRARY=/work/mynfs/open_source/oss_prefix/lib/libapr-1.a -DAPR_UTIL_INCLUDE_DIR=/work/mynfs/open_source/oss_prefix/include/apr-1 -DAPR_UTIL_LIBRARY=/work/mynfs/open_source/oss_prefix/lib/libaprutil-1.a -DMINIXML_INCLUDE_DIR=/work/mynfs/open_source/oss_prefix/include/ -DMINIXML_LIBRARY=/work/mynfs/open_source/oss_prefix/lib/libmxml.a -DCMAKE_INSTALL_PREFIX=/work/mynfs/open_source/ossDstPath

 

出现/work_dv300/arm-himix/arm-himix200-linux/host_bin/../lib/gcc/arm-linux-gnueabi/6.3.0/../../../../arm-linux-gnueabi/bin/ld: ../build/bin/oss_c_sdk_sample: hidden symbol `curl_easy_getinfo' in /work/mynfs/open_source/oss_prefix/lib/libcurl.a(libcurl_la-easy.o) is referenced by DSO

 

修改使用curl 7.32.0版本的库并且使用动态库即可。

 

部分bug解决内容参考文档网址为 https://blog.csdn.net/m0_37263637/article/details/78590853 

                                      https://www.cnblogs.com/zhangsf/archive/2013/08/21/3272960.html

感谢分享的网友。

 类似资料: