class="hljs-ln-code"> class="hljs-ln-line">export AS=${OHOS_SDK}/native/llvm/bin/llvm-as
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="3"> class="hljs-ln-code"> class="hljs-ln-line">export CC="${OHOS_SDK}/native/llvm/bin/clang --target=arm-linux-ohos"
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="4"> class="hljs-ln-code"> class="hljs-ln-line">export CXX="${OHOS_SDK}/native/llvm/bin/clang++ --target=arm-linux-ohos"
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="5"> class="hljs-ln-code"> class="hljs-ln-line">export LD=${OHOS_SDK}/native/llvm/bin/ld.lld
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="6"> class="hljs-ln-code"> class="hljs-ln-line">export STRIP=${OHOS_SDK}/native/llvm/bin/llvm-strip
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="7"> class="hljs-ln-code"> class="hljs-ln-line">export RANLIB=${OHOS_SDK}/native/llvm/bin/llvm-ranlib
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="8"> class="hljs-ln-code"> class="hljs-ln-line">export OBJDUMP=${OHOS_SDK}/native/llvm/bin/llvm-objdump
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="9"> class="hljs-ln-code"> class="hljs-ln-line">export OBJCOPY=${OHOS_SDK}/native/llvm/bin/llvm-objcopy
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="10"> class="hljs-ln-code"> class="hljs-ln-line">export NM=${OHOS_SDK}/native/llvm/bin/llvm-nm
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="11"> class="hljs-ln-code"> class="hljs-ln-line">export AR=${OHOS_SDK}/native/llvm/bin/llvm-ar
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="12"> class="hljs-ln-code"> class="hljs-ln-line">export CFLAGS="-fPIC -D__MUSL__=1"
  • class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="13"> class="hljs-ln-code"> class="hljs-ln-line">export CXXFLAGS="-fPIC -D__MUSL__=1"
  • class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    3、编译OpenSSL,其中--prefix为SSL的安装路径,linux-armv4可以根据情况更改(如linux-aarch64)

    ./Configure linux-armv4 --prefix=/home/include/ohos-sdk/linux/native/sysroot/usr/ class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    安装Poco

    1、下载Poco源码,本文选择的是poco-1.9.4-all.tar.gz

    2、将源码解压,并进入当前文件夹,创建build.clang用于存放编译生成的文件

    1. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="1"> class="hljs-ln-code"> class="hljs-ln-line">root@a9ba6b86a9dd:/home# cd /home/include/poco-1.9.4-all/
    2. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="2"> class="hljs-ln-code"> class="hljs-ln-line">root@a9ba6b86a9dd:/home/include/poco-1.9.4-all# mkdir build.clang
    3. class="hljs-ln-numbers"> class="hljs-ln-line hljs-ln-n" data-line-number="3"> class="hljs-ln-code"> class="hljs-ln-line">root@a9ba6b86a9dd:/home/include/poco-1.9.4-all# cd build.clang
    class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    3、编译Poco源码

    /home/include/ohos-sdk/linux/native/build-tools/cmake/bin/cmake -DCMAKE_TOOLCHAIN_FILE=/home/include/ohos-sdk/linux/native/build/cmake/ohos.toolchain.cmake -DOPENSSL_ROOT_DIR=/home/include/ohos-sdk/linux/native/sysroot/usr/ -DCMAKE_BUILD_TYPE=Release -DENABLE_DATA_MYSQL=OFF -DENABLE_DATA_ODBC=OFF -DENABLE_MONGODB=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_REDIS=OFF -DENABLE_TESTS=OFF -DPOCO_STATIC=ON -DOHOS_ARCH=armeabi-v7a.. -L class="hljs-button signin active" data-title="登录复制" data-report-click="{"spm":"1001.2101.3001.4334"}" onclick="hljs.signin(event)">

    确保编译时找到的OpenSSL为使用鸿蒙工具链编译得到的路径

    4、使用make、make install命令,得到连接库以及头文件

    >>
    注:本文转载自blog.csdn.net的一只蜉蝣_的文章"https://blog.csdn.net/m0_63282074/article/details/143873824"。版权归原作者所有,此博客不拥有其著作权,亦不承担相应法律责任。如有侵权,请联系我们删除。
    复制链接

    评论记录:

    未查询到任何数据!