FastCGI / CGI C++ Library | Docs | Examples | Source | Downloads

The goals of the library are to provide a cross-platform API for writing CGI (+FastCGI) programs that can be super-fast, scalable, concise and maintainable. The major features of the library:

What's needed really are good, portable, modern C++ libraries for database programming, HTML templating, etc. If you use or wrote any particularly good ones, please email me at The examples herein are quite contrived, mainly since they don't use a database. As soon as a de-facto database library comes around, the examples can be fleshed out.

There are examples that *use* HTML templates. The library used for doing that is Google's ctemplate. That library is very focused on templating (not even necessarily HTML - it could be XML, JSON or even MSXML and it wouldn't make a difference) and it by far the best of its ilk that I know of.

This library has been developed to make CGI programming as easy in C++ as possible, with the explicit intention of exposing as much as reasonably possible to the programmer, in case they have a use for it. I think the examples shown in the linked docs above should be relatively straight-forward, even to those relatively new to C++, or programmers who have used Python before.

There are several Boost C++ libraries used in the core of this one:

Apart from the examples - a couple of which require Google ctemplate and another couple that require Boost.Chrono (it's currently in the Boost SVN sandbox and used for timing requests) - there are no library dependencies apart from Boost. The code aims to be completely standard C++, wherever possible.

It's been tested on a 64bit Ubuntu linux machine and MSVC9.0 on Windows. There are some MSVC projects in the libs/cgi/build/msvc directory, made using MSVC 2008 (sorry, I don't have any other copy).