We have implemented a version of the C++ STL in a Solaris 2.6 environment using Sun's WorkShop Compiler C++ 4.2. We get the symbol referencing errors (see output below) when we try to use a hash map in the program. The "__stl_prime_list" which gives the error is declared in hashtable.h as static const array of unsigned long's.

If, however, we compile in debug mode (using -g flag), we don't have a problem. We have used the "nm" command to look at the symbols in the object files and sure enough, when compiled in debug mode, everything is peachy, but without debug, the symbol is, for lack of a better word, toast.

One of our developers believes it has to do with the fact that debug mode uses "stabs".

It seems to be a combination of "static const" and templates that cause the problem. We've tried using a centralized template database but it makes no difference. We are also using static libraries but we've tried compiling/linking everything in one statement without libraries with no effect.

Has anyone seen this type of problem on this or any other platform?

Here is the output from the compile/link.

/opt/SUNWspro/SC4.2/bin/CC SpeedTestCanadianRoutingMap.cpp -o
SpeedTestCanadianRoutingMap +p -KPIC -temp=/var/tmp
-I/home/logic7/macfar/stl -DCOMPILE_STYLE=CPP_COMPILE -DNONE_CLASH
-DRW_STD_TYPEDEFS -mt -I/vobs/forecast/FC/common -I.
-I/vobs/forecast/framework/base -I/vobs/forecast/framework/app
-I/vobs/forecast/framework/primitive -I/vobs/forecast/framework/container
-I/vobs/forecast/framework/complex -I/vobs/forecast/framework/data_access
-I/vobs/forecast/AR/dbut -I/software/Rogue7.0.A
-I/software/oracle8/precomp/public -L/opt/SUNWspro/SC4.2/lib
-L/vobs/forecast/staging/pvt_lib -L/vobs/forecast/staging/lib
-L/software/Rogue7.0.A/lib -L/lib -L/software/oracle8/lib -lsql8 -lclntsh
-lctx8 -lFramework -lDbUt -ltls7s -ldbt7s -lor87s -lm -lmp -lsocket -lnsl
template manager : Warning: No valid template database available. Creating
default repository "Templates.DB".
Undefined first referenced
symbol in file
__stl_prime_list
/vobs/forecast/staging/pvt_lib/libFramework.a(NElK8L3maHMK.o)
ld: fatal: Symbol referencing errors. No output written to
SpeedTestCanadianRoutingMap
*** Error code 1
clearmake: Error: Build script failed for "SpeedTestCanadianRoutingMap"