extern "C" linkage and template declarations

Hi,

The following error message has started poping up since upgrading to Sun Studio 11:

"sstream", line 41: Error: Template declarations cannot have extern "C" linkage.

As far as i understand, sstream is a library that comes with Sun Studio so how should I interpret this message? Is it saying that the template declared in sstream at line 41 is being used in my code with types that use extern "C" linkage?

[432 byte] By [Al_Kingstona] at [2007-11-27 4:19:21]
# 1

Hi

I think that the most likely cause of this is some code that does

extern "C" {

#include "some_header.h"

}

sstream is the name of the header that is part of the standard C++ library interface that defines stringstream. If 'some_header.h' either directly or indirectly includes sstream, then you will get the error that you see.

You can solve this by doing something like

extern "C++" {

#include <sstream>

}

Paul

Paul_Floyda at 2007-7-12 9:26:17 > top of Java-index,Development Tools,Solaris and Linux Development Tools...