Building TinyOWS with Visual C++ Express Edition 2008 using dependecies from OSGeo4W

Материал из GIS-Lab
Перейти к: навигация, поиск
Эта страница опубликована в основном списке статей сайта
по адресу

How to build TinyOWS on Windows.

This tutotial shows how to build latest TinyOWS code (trunk) on Windows XP Professional with Microsoft Visual C++ 2008 Express Edition using dependencies from OSGeo4W.



First of all we need to do initial setup of the build environment. This described in appropriate article.

Important dependencies

Now we have to attend to the dependencies of TinyOWS. We need:

  1. libxml2 (>=2.6.20)
  2. iconv
  3. regex
  4. fastcgi
  5. Flex
  6. PostgreSQL (with libpq include files)
  7. PostGIS (1.5.x or higher)

Fortunately all dependecies, except last three items, can be installed with OSGeo4W installer. Choose "Advanced install" and standard directory (C:\OSGeo4W). If you install it in another directory be careful and correct all path below.

Download Flex and install it in C:\OSGeo4W.

Unfortunately PostgreSQL and PostGIS are not available in OSGeo4W so download and install PostgreSQL. Then using StackBuilder install PostGIS 1.5.0 or higher. If you can't use StackBuilder there is a standalone PostGIS installer.

Get TinyOWS sources

Download and install Subversion. Add subversion directory to the PATH environment variable.

Create directory for TinyOWS sources. Go to "Start → Run" and enter cmd, then go to directory created on previous step and checkout TinyOWS sources:

svn co

Building and installation

Assuming that PostgreSQL installed in default directory C:\Program Files\PostgreSQL\9.0 and TinyOWS sources are in D:\devel\cpp\tinyows directory.

Go to TinyOWS sources directory and edit nmake.opt file:

  1. find variable TINY_BASE (string 36) and point it to sources directory
    TINY_BASE = D:\devel\cpp\tinyows
  2. find POSTGIS_DIR variable (string 102) and point it to the PostgreSQL installation directory (quotes are important!)
    POSTGIS_DIR ="c:\Program Files\PostgreSQL\9.0"
  3. enter path to libxml and iconv files (strings 112 and 125)
  4. setup regex location in string 143
  5. strings 183 and 185 should looks like
    POSTGIS_INC=-I"c:\Program Files\PostgreSQL\9.0\lib\libpq" -I"c:\Program Files\PostgreSQL\9.0\include"
    POSTGIS_LIB="c:\Program Files\PostgreSQL\9.0\lib\libpq.lib"

Save edits and close editor.

Edit file D:\devel\cpp\tinyows\ At the end of the string 19 add C:\OSGeo4W\lib\libfcgi.lib, so string should look like this

CFLAGS=$(BASE_CFLAGS) $(TINY_CFLAGS) c:\OSGeo4W\lib\libfcgi.lib

Edit D:\devel\cpp\tinyows\src\ String 27 should be


And string 32

#define TINYOWS_FCGI                1

If you don't want FastCGI support replace 1 with 0. IMPORTANT! Without FastCGI you get low performance.

Now edit file C:\OSGeo4W\include\regex-0.12\regex.c. Replace strings 4876-4880

regerror (errcode, preg, errbuf, errbuf_size)
    int errcode;
    const regex_t *preg;
    char *errbuf;
    size_t errbuf_size;

with the single string:

regerror (int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)

That's all, now we are ready to compile. Open Visual Studio command prompt from "Start → Programs → Microsoft Visual C++ 2008 Express Edition → Visual Studio Tools → Visual Studio 2008 Command Prompt". Go to the TinyOWS source dir and run

nmake /f

Process take a while, when it's done tinyows.exe (server application) and tiny.lib (library file) should appear in the sources directory.

Ссылки по теме

Персональные инструменты
Пространства имён