After you download the header file and the library(s) appropriate for your programming environment, you may wish to install them to make them readily available to your programs. Installation is simply a matter of renaming the library to a simpler name, and putting the header file and library in publicly accessable areas (esp. accessable to your compiler/linker).
Linux Installation
This installation puts the header files and libraries into public places so they are easily accessed by all your programs. The public areas are usually /usr/include and /usr/lib OR /usr/local/include and /usr/local/lib. We have assumed /usr/lib and /usr/include for these instructions.
NOTE: You may have to have super user priveleges (eg. logged in as root) to install CGIParser in the fashion explained below. If you don't, see the poor man's installation section near the bottom of this page.
1. If it doesn't already exist, create a public rude include directory under /usr/include (or /usr/local/include)
>mkdir /usr/include/rude
>chmod 755 /usr/include/rude2. Copy the Database header file (
database.h
) to the /usr/include/rude directory.
>cp cgiparser.h /usr/include/rude/database.h
>chmod 644 /usr/include/rude/database.h
3. Copy the appropriate library to the /usr/lib directory
For Shared Library:
>cp rudecgiparser.so.2.0_i386 /usr/lib/rudedatabase.so
>chmod 644 /usr/lib/rudedatabase.so
For Regular Library:
>cp rudecgiparser.lib.2.0_i386 /usr/lib/rudedatabase.lib
>
chmod 644 /usr/lib/rudedatabase.lib
Borland CBuilder5 Installation
This installation puts the header files and libraries into public places so they are easily accessed by all your programs. You will need to find Borland's Include and Lib directory. Depending, of course, on where you installed it, the paths will look something like:
C:\Program Files\Borland\CBuilder5\Include
And
C:\Program Files\Borland\CBuilder5\Lib
If you just want to dive in and use the component, use the poor man's installation explained near the bottom of this page.
1. If it doesn't already exist, create a public rude include directory under Borland's Include directory
>mkdir "C:\Program Files\Borland\CBuilder5\Include\rude"
2. Copy the Database header file (
database.h
) to the directory created above3. Copy the borland version of the Database library to Borland's Lib Directory, renaming it to rudedatabase.lib
>copy rudedatabase.lib.1.0_bor C:\Program Files\Borland\CBuilder5\Lib\rudedatabase.lib
4. Copy the Borland version of the mysql library to the same place as step 3
>copy libmySQL.lib C:\Program Files\Borland\CBuilder5\Lib\libmySQL.lib
5. Put the Borland mySql DLL (libmySQL.dll) in a system directory ("C:/windows"), or the same directory as your application.
Poor man's installation
If you do not have root priveleges and cannot install the component or don't feel like going through the installation, you can simply copy the header file (database.h) and the library ( the static library when using linux!!! ) to the same directory as your source files. To make the library easier to deal with when linking, rename it to rudedatabase.lib. Our "Poor man's compilation" example assumes this name. This installation applies to Borland and Visual C++ as well.
When using the Database component in your program, you will need to include the header file a bit differently in your source/header files:
// Use the following include directive for poor man's installation:
#include "cgiparser.h"
// Instead of the following, which you would use in the normal installation
#include <rude/cgiparser.h>