windows环境
使用windeployqt.exe 打包
cmd
# 进入exe目录,执行windeployqt命令,注意Qt的安装目录
D:\Qt\Qt5.9.6\5.9.6\mingw53_32\bin\windeployqt.exe my.exe
linux环境
使用ldd命令打包
sh
#!/bin/bash
LibDir=$PWD"/lib"
Tag=$1
lib_array=($(ldd $Tag | grep -o "/.*" | grep -o "/.*/[^[:space:]]*"))
$(mkdir $LibDir)
for Variable in ${lib_array[@]}
do
cp "$Variable" $LibDir
done