This demo is a merge of two dll examples.
https://wiki.qt.io/How_to_create_a_library_with_Qt_and_use_it_in_an_application
http://www.mingw.org/wiki/sampledll
https://wiki.qt.io/How_to_link_to_a_dll
To do this in Windows with MinGW w64... get your qt + mingw setup using the following:
http://www.msys2.org/ get the version with x86_64 in the installer name.
Follow pacman instructions here: https://wiki.qt.io/MinGW-64-bit
pacman -Sy
pacman -S bash pacman pacman-mirrors msys2-runtime
# may have to close the msys2 window here if there is a warning that says to do so
pacman -Su
pacman -S base-devel git mercurial cvs wget p7zip
pacman -S perl ruby python2 mingw-w64-x86_64-toolchain # mingw-w64-i686-toolchain
pacman -S mingw-w64-x86_64-qt-creator
pacman -S mingw-w64-x86_64-qt5-static