CGI++: A C++ Library for CGI programming

The current version is 2000-11-10, which is basically an update to remove the dependence on the no-longer-supported GNU libg++ and the C librx, which appears to be system-dependent. This is the second update concerned with GNU libraries++: the update of 2000-08-02 got rid of dependence on libg++ but left a remaining dependancy on librx.

An additional Smart Text class is also provided.


Since the CGI protocol was first defined in 1993, Perl has been the majority language for CGI programming. A major reason for this is the superb libraries available, including CGI.pm for elementary tasks and the LWP for more advanced applications.

C and C++ are less well-served. Libraries including Jemtek's and Boutell's exist for C, but do not provide the notational convenience of CGI.pm. In this author's uninformed view - having read the documentation but not the source - they are closer to the obsolete Perl "cgi-lib.pl". To the best of my knowledge (based on - among other things - regular participation in the CGI newsgroup and a reading of Nikki Locke's C++ Libraries list), no libraries whatsoever exist for C++.

CGI++ not only fills that gap, but is I believe the first library in any language written for CGI programming with HTTP/1.1.

CGI++ provides programmers with direct access to CGI/1.1 and HTTP/1.1. It resists the temptation to offer incompatible proprietary 'enhancements', adopted by many "No CGI required" programming packages. So you are not stuck with a nightmare hack as soon as you need to do something the Author didn't foresee.


CGI++ combines an easy and intuitive 'look and feel' (inspired in some measure by CGI.pm) with a powerful and rich object-oriented implementation. Features include:

Related Projects

CGI++ is not under active development, and future developments remain a wish-list. Some areas of prospective future work include:


CGI++ comprises three main modules:
  1. FEP (Form Element Pointer) is a deep object-orietented class hierarchy of the Form Elements.
  2. FORM defines (and manages) HTML Forms as collections of FEPs.
  3. CGI extends FORM, with CGI and HTTP environment variables and form data, and interactive emulation (debug mode). Parts of CGI properly belong in the HTTP classes.

In addition, some accessory functions are provided.

19970222: The new Manual/Programmers Guide is a lot more complete than the old Technical Overview, but I'm keeping both for the time being. See also the sample programs source code.


CGI++ is free software subject to the terms of the GNU Library General Public License (LGPL).


CGI++ is now believed to be fully POSIX and ANSI compliant. If you find anything that fails either of these standards, please let me know!

Further Information

The following are provided on the CGI++ website: <URL:http://www.webthing.com/cgiplusplus/>