This is a rough guide on getting the code to compile under Linux.
Download the source
See the detailed notes
here
Download Qt
The code uses version 4 of Qt whilst many Linux distributions come provided with Qt many also have the older version 3. Sadly that will not do because this code uses many of the new features that are available with version 4. Not certain which version you are using, the following command should help out
qmake --version
On my machine that gave the following information
QMake version: 2.00a
Using Qt version 4.1.2 in /usr/local/Trolltech/Qt-4.1.2/lib
So my version of Qt is alright it's 4.1.2 (
just as well since I've been writing the code)
If you need to download Qt so that you have the latest version then try
here
Download PostGreSQL
This is a database application and currently it uses PostGreSQL as the back end, it has been tested with version 8, I'm not certain if earlier versions will work because of the way the procedures have been written. So if you do need the latest and greatest from PostGreSQL try
here or locate you favourite package manager. I also recommend ensuring that you have pgAdmin III on your system, it's an invaluable tool for looking at the database.
Compile Qt
The Qt libraries need to be compiled with support for the pgsql driver. So the following configuration switch should help:
./configure -qt-sql-psql -I/usr/local/pgsql/include -L/usr/local/pgsql/lib
The above assumes that the pgsql is located in /usr/local/ if you're unable to find where the sources for pgsql are, try the following:
slocate libpq-fe.h
Once you have configured Qt you just need to
make
, followed by
make install
. Like most compiles of large programs this takes quite a while so use this time to get out enjoy some fresh air.
Compile the source
This should be a case of using the following commands:
qmake
make
Now you need to jump ahead to the section on running the program.
This is a rough guide on getting the code to compile under Windows.
Download the source
See the detailed notes
here
Download Qt
The code uses version 4 of Qt you can download a binary of Qt from
here
Download MinGW
The open source version of Qt uses the MinGW compiler, which is available
here, or if you prefer you can download the MinGW version of
DevC++, select the version with Mingw/GCC.
Download PostGreSQL
This is a database application and currently it uses PostGreSQL as the back end, it has been tested with version 8, I'm not certain if earlier versions will work because of the way the procedures have been written. So if you do need the latest and greatest from PostGreSQL try
here. I also recommend ensuring that you have pgAdmin III on your system, it's an invaluable tool for looking at the database. A gudie to installing postgresql is given
here.
Compile Qt plugin for pgsql
The Qt installer will provide you with a basic version of Qt, unfortunately that doesn't include the SQL plugin for pgsql. Thankfully all the Qt code is provided so it is a matter of compiling it with the pgsql source. You need to know where PostGreSQL has put the included files. Typically this is in the
Program Files\PostgreSQL
. Unfortunately that is not very helpful because the minGW compiler doesn't take too kindly to spaces in the file path. So here is my suggestion:
Locate the Qt directory and then the psql source code, on my system it is at:
C:\Qt\4.1.2\src\plugins\sqldrivers\psql
Now copy the include and lib directories from the PostgreSQL directory, from my system that was from
C:\Program Files\PostgreSQL\8.1\lib
and
C:\Program Files\PostgreSQL\8.1\include
. Just copy those two entire folders into the psql folder. Then run qmake as follows:
qmake -o Makefile "INCLUDEPATH+=C:\Qt\4.1.2\src\plugins\sqldrivers\psql\include" "LIBS+=C:\Qt\4.1.2\src\plugins\sqldrivers\psql\lib\ms\libpq.lib" psql.pro
Then run
make
This will then generate the psql dll which will be in the
C:\Qt\4.1.2\plugins\sqldrivers\
directory.
Compile the source
This should be a case of using the following commands:
qmake
make
Now you can go to the section on running the program.
Please be patient...I'm getting there.