To know which dll libraries need to be bundled with your application, the safest way is to profile your app at runtime, because some libraries may be loaded just at runtime (e.g. Qt plugins). We use MSYS2 (https://www.msys2.org/) for compiling our apps with GCC and MSYS2 contains the strace
package which we use here to get a list of loaded dll libraries:
/usr/bin/strace ANY_APP.exe 2>&1 \
| tee out.log \
| grep -a -E '^--- Process .* loaded .*\.dll' \
| cut -d' ' -f 5- \
| sed 's/\.dll.*/.dll/' \
| sort -u
Explanation:
- store full output to
out.log
- take just lines with dll loading messages
- take columns starting with the file path
- remove everything after
.dll
- sort and keep only unique paths