STL and (uncaught) exceptions

STL and (uncaught) exceptions

I have been trying to compile a program which uses STL and exceptions. The following piece of code will produce an error, and I am not able to figure out why:


int main(void) {
try {
catch ( ... ) {
if ( ! std::uncaught_exception() )
return (0);
/tmp$ icpc -O -Wall -o test test.cpp
test.cpp(8): error: namespace "_STL" has no member "uncaught_exception"
if ( ! std::uncaught_exception() )

compilation aborted for test.cpp (code 2)

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I should of course have mentioned that I am using stlport version 4.5.3 under FreeBSD. (Yes, Linux icc works under FreeBSD!)


I tried this example on IA-32 Linux system, and it compiles. I generated the preprocessed file (icc -E exception.cxx >& exception.i) and found where it's defined:

bool uncaught_exception() throw ();
in /include/c++/exception

If I use g++ STL libraries w/ icc ( icc -cxxlib-gcc -E exception.cxx >& exception2.i) I find it's defined in

I have a couple of questions:
1) How is icc configured to use STLport (change the default include dir search, etc)
1) Are you able to compile this example w/ gcc & STLport ?

John O'Neill

Thank you for your reply. I resolved this issue by upgrading STLport to version 4.6.1 (which is the latest stable version). I am not sure why FreeBSD is lacking so far behind the latest STLport releases -- but I shall contact the maintainer of the FreeBSD ports and ask them to upgrade to a newer version.

Leave a Comment

Please sign in to add a comment. Not a member? Join today