Important: Please read the Qt Code of Conduct -

static build qt with pgsql, but still need libpq.dll

  • Qt5.6.3+msvc2015
    build with this script:

    REM ********** Initialize env for msvc 2015 cl compiler **********
    SET PATH=C:\Windows;C:\Windows\system32;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
    REM Set up \Microsoft Visual Studio 2015, where <arch> is amd64, x86, etc.
    CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
    REM ********** Update include & lib to support xp win sdk 7.1A **********
    SET PATH=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin;%PATH%
    SET INCLUDE=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;%INCLUDE%
    SET LIB=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib;%LIB%
    SET CL=/D_USING_V140_SDK71_;%CL%
    REM ********** 3rd party build tools binaries: ruby, perl, python ********** 
    SET PATH=F:\Programs\Perl64\bin;F:\Programs\Python37;%PATH%
    REM ********** Set up qt source env **********
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%
    REM Uncomment the below line when using a git checkout of the source repository
    REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH%
    SET QMAKESPEC=win32-msvc2015
    SET _ROOT=
    REM Generate makefile
    F:\QTSRC\configure.bat -confirm-license -opensource -platform win32-msvc2015 -debug-and-release -static -target xp -prefix F:\QtStatic\Qt5.6.3 -qt-sql-sqlite -qt-sql-odbc -qt-sql-psql -plugin-sql-sqlite -plugin-sql-odbc -plugin-sql-psql -I F:\PostgreSQL\include -L F:\PostgreSQL\lib -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -qt-freetype -no-qml-debug -no-angle -nomake tests -nomake examples -skip qtquickcontrols -skip qtsensors -skip qtdoc -mp

    build success, but in my application, still need some pg dlls to run:

    what should I do?

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    If you want to have a full static build, you'll have get the static librairies of all your dependencies.

Log in to reply