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
4 Comments:
Thank you so much for this excellent set of instructions. Got them to work with the 0.9.0 beta and Postgres 9.6 One minor addendum is that I had to copy iconv.dll from PostgreSQL into the final pgmodeler directory at the end to get it to run.
By Unknown, at 3:31 PM CDT
Thank you for the tutorial, you really saved my day. I have tested it with pgAdmin 0.9.0 beta2. You need to copy zlib1.dll from C:\PostgreSQL\9.6\bin to C:\pgAdmin to make it work on another computer without having to install PostgreSQL.
By Alex Carranza, at 7:41 AM CDT
PgModeler 0.8.2 and PostgreSql 9.6 works fine :)
Thank you for the tutorial. When I finish I have got problem with start pgModeler. I must copy file C:\Program Files\PostgreSQL\9.6\bin\libconv-2.dll to c:\pgModeler and change name to iconv.dll after this work fine.
By Anonymous, at 6:17 AM CDT
I did everything as you post (windows 10, x64, PG 9.6 x64, pgModeler 0.9.0).
But got this error:
C:\pgmodeler-0.9.0>g++ --version
g++ (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
C:\pgmodeler-0.9.0>qmake PREFIX+=C:/pgModeler -r -spec win32-g++ CONFIG+=release pgmodeler.pro
Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
Any help?
By Unknown, at 12:02 PM CDT
Post a Comment
<< Home