Building and installing CGIRef

What the package contains

CGIRef source code for the library Actual source code to create libcgiref.a
CGIRef Header file Include file for the library.
Test Programs Programs to call from a form to debug CGI apps.
Example program source code Examples to familiarize you with CGIRef.
HTML Documentation Documentation for CGIRef.

Building the library

CGIRef should port to your system fairly easily. I wrote it in ANSI C, and compiled it with egcs 2.91.66 on Red Hat Linux 7.1 Please let me know if you have any problems porting. Basically, just unwind the compressed tar file into any directory and type make. This will create the static libraries and all static-link executables in the ./bin directory. See the README file for notes on creating shared libs & dynamically-linked executables.

Installing the library & test executables

A lot of this depends on whether you built the static or shared libs.

IF you have built the static libs (the default), then copy the header file, cgiref.h, to the /usr/include directory, and copy the libcgiref.a file from the ./bin directory to the /usr/lib directory.

OTHERWISE, you have built the shared libs. In that case, copy the include as above, but copy the libcgiref.so file from the ./bin directory to the /lib directory.

Now you need to copy the test executables. They will be in the ./bin directory. Copy them to your cgi-bin directory (wherever that is, it varies from system to system). These can usually be access by an URL like:
http://hostname.domain.com/cgibin/testpage.cgi

Porting to Win32 Platforms

Please see the README file in the root of the distribution for porting notes.

Compiling & Linking Programs

Just create your source source C/C++ program, and link with cgiref. Under egcs (GNU C Compiler) do something like:
gcc -o exename sourcefile.c -lcgiref

For Visual C++ just include CGIREF.LIB (or CGIREFIMPORT.LIB) on the linker command line.

NOTE: Be sure and delete the test executables from any CGI directories before you go live with your site! These programs(and others like them) provide detailed information about your web server's environment, and as such should only be used in a testing or lab environment.