linux下打包qt程序依赖库(x86/arm均适用)

  • Post author:
  • Post category:linux


将可执行程序依赖库打包到当前路径下

./pack_static.sh ./xxx ./plugins/lib-arm

pack_static.sh内容如下

#!/bin/bash

LibDir=$PWD/$2

Target=$1

lib_array=($(ldd $Target | grep -o "/.*" | grep -o "/.*/[^[:space:]]*"))

$(mkdir $LibDir)

for Variable in ${lib_array[@]}

do

    cp "$Variable" $LibDir

done

//linux下打包qt依赖库不全

将pack_libqxcbso.sh 拷贝到Qt的plugins/platforms/路径下

./pack_libqxcbso.sh ./libqxcb.so

cp ./lib/* (工程plugins下对应平台的路径)

pack_libqxcbso.sh内容如下

#!/bin/bash
 
LibDir=$PWD"/lib"
Target=$1
 
lib_array=($(ldd $Target | grep -o "/.*" | grep -o "/.*/[^[:space:]]*"))
 
$(mkdir $LibDir)
 
for Variable in ${lib_array[@]}
do
    cp "$Variable" $LibDir
done



版权声明:本文为qq_45024766原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。