How to compile pgModeler 8.2 for Win7 and PostgeSQL 9.5
pgModeler is a great tool for creating PostgreSQL queries but the documentation on compiling for Windows is old and incomplete. Here are the steps I took to compile it on Windows 7. All software is 32bit as QT does not support x64 on Windows.
- Install PostgreSQL server. (I installed to C:\Program Files (x86)\PostgreSQL\9.5)
- Install QT framework (C:\Qt)
- Download the XML2 Library and (C:\Program Files (x86)\libxml2\) and copy libxml2.lib to (C:\Program Files (x86)\PostgreSQL\9.5\lib)
- Install MiniGW. Download mingw-get-setup.exe and run, then select:
- minigw-developer-toolkit
- minigw-gcc-v3-g++
- the 4 minigw32-gcc-g++ packages (bin, dev, doc, man)
- Add to PATH environment variable (adjust paths as required)
C:\Program Files (x86)\PostgreSQL\9.5\bin\;C:\MinGW\bin\;C:\Qt\5.6\mingw49_32\bin\ - Download pgModeler source code. Unzip to C:\pgmodeler-8.2.0\
- Edit pgmodeler.pri and add above the Windows section (adjust paths as required):
- PGSQL_LIB = "C:/Program Files (x86)/PostgreSQL/9.5/lib/libpq.dll"
- PGSQL_INC = "C:/Program Files (x86)/PostgreSQL/9.5/include/"
- XML_INC = "C:/Program Files (x86)/libxml2-2.7.8.win32/include"
- XML_LIB = "C:/Program Files (x86)/libxml2-2.7.8.win32/bin/libxml2.dll"
- Make directory C:\pgModeler\
- Open a command prompt then change to the source code directory [CD C:\pgmodeler-8.2.0\]
- Run: [qmake PREFIX+=C:/pgModeler -r -spec win32-g++ CONFIG+=release pgmodeler.pro]
This configures the project files - Run: [mingw32-make -j5] to compile the project
- Run: [mingw32-make install] to move the compiled files into C:\pgModeler\
- Run: [CD C:\pgModeler]
- Run: [windeployqt pgmodeler.exe] to copy the QT files to the program directory
- Now copy these DLLs to C:\pgModeler
- PostgreSQL DLLs (PostgreSQL\9.5\bin)
libeay32.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
ssleay32.dll - QT DLLs (C:\Qt\5.6\mingw49_32\bin\)
libwinpthread-1.dll
Qt5Network.dll
Qt5PrintSupport.dll - XML2
libxml2.dll