Installing the Standard Template Library ( STL )

As of this date: 6/18/01 The current SRL that I am using was downloaded from The latest stable version is 4.0 (July 14, 2000). Select download option and you will be presened a [age with STL download options. This step by step assumes you will select the By clicking on a link below, you may download the latest compressed tar file STLport-4.0.tar.gz, which is 750KBytes, to the directory on your system that you use for downloads. I personnally use a DownLoadsunder the /opt filesystem. I also sepearate downloads files into specific directories according to types.

The following are standard operations to setup the compiling of the source code. I will do it in detail so that if a newbie, that is some one who has not been around as long as I have been & that not long as most, will have a roadmap to follow. I will use my system as it is setup, modify to fit yours. I always move to the root user before I start, just what I do, unpacking configuring & compiling can be done as user. The "make install" must be run as root.

cd /opt/DownLoads/STL_Lib This where I downloaded the STLport-4.0.tar.gz.

# gunzip STLport-4.0.tar.gz ¿

# tar xvf STLport-4.0.tar ¿

# cd STLport-4.0 ¿

At this time if you perform a directory listing, the below is what you should see:

-rw-r--r-- 1 rick users 28319 Jul 13 2000 ChangeLog

-rw-r--r-- 1 rick users 5452 Jul 13 2000 INSTALL

-rw-r--r-- 1 rick users 2063 Jul 13 2000 README

-rw-r--r-- 1 rick users 1392 Jul 13 2000 TODO

drwxr-xr-x 3 rick users 1560 Jul 14 2000 doc

drwxr-xr-x 3 rick users 320 Jun 15 19:40 lib

drwxr-xr-x 5 rick users 3512 Jul 13 2000 src

drwxr-xr-x 9 rick users 2432 Jun 15 07:16 stlport

drwxr-xr-x 4 rick users 104 Jul 13 2000 test

[root@RSivernell STLport-4.0]#

At this point you can do one of tthree things:

  1. Move the entire directory tree to it to a new loaction that will be put into your path.

  2. Compile and build the libray and then move it.

  3. Compile and build the libray and then leave it where it is now on your system.

I moved mine to the /opt filesystem as /opt/ STLport-4.0. I suggest you read the INSTALL file as the instructions are very detailed for all types of makes. I used the following command as it performed flawlessly: "make -f gcc.mak clean all" in the src directory.

# cd src ¿

# make -f gcc.mak clean all ¿

Well you almost done. I put a symlink from the /lib filesystem for each of the libraries created in the directory STLport-4.0/lib, as shown below.

[root@RSivernell STLport-4.0]# ll lib

total 64056

-rw-r--r-- 1 root root 2983144 Jun 15 19:33 libstlport_gcc.a

-rwxr-xr-x 1 root root 1681461 Jun 15 19:23

-rw-r--r-- 1 root root 20053524 Jun 15 19:36 libstlport_gcc_debug.a

-rwxr-xr-x 1 root root 6075155 Jun 15 19:25

-rw-r--r-- 1 root root 26614402 Jun 15 19:40 libstlport_gcc_stldebug.a

-rwxr-xr-x 1 root root 8172435 Jun 15 19:29

sample symlink:

ln -s /opt/STLport-4.0/libstlport_gcc.a /lib/libstlport_gcc.a

Well, you have installed the STL for use in your system.

At this time I am using Kdevelop & Kdbg development system and I will coninue as how I setup STL for use in them. If you have a different development system, you are on your own here. After you have it all worked out, please add it to this Step for others.

Really not much here, you should have Kdevelop, Kdbg & dbg already installed and operational before you try putting the STL.

In kdevelop, I assume you have started the program, create a new project or select an exsisting project. The normal templates used will have ".h" in the include section of the translation unit.

#include <iostream.h>

When you use the new STL templates you will need to remove the ".h". Basicly follow all the new rules for templates. Then press"F7" to the General Project Information dialog box. Select the "Make Options" and put the absolute path, in my system it is "/opt/STLport-4.0/stlport". in the additional options edit field.

Well for Kdevelop that was all there was to it. You are ready to use the STL on kdeveloper. Enjoy & Happy Developing.

Rick Sivernell

Dallas, Texas 75287