P
Praveen Chandra
Hi,
I am trying to build a static library, while building the library i am
getting the following error:
fatal error C1189: #error : "No sstream/strstream implementation"
Following is the code that is giving error:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_SSTREAM
# include <sstream>
#elif HAVE_STRSTREAM
# define USE_STRSTREAM_WRAPPERS
#else
# error "No sstream/strstream implementation"
#endif
#if defined(USE_STRSTREAM_WRAPPERS) && !defined(SSTREAM_FIX_H)
#define SSTREAM_FIX_H
#include <string>
#include <strstream>
namespace std
{
/*
* Only limited functionality from ostringstream
* is implemented
*/
class ostringstream : public ostrstream {
public:
string str() {
char *cstr = ostrstream::str();
freeze(0);
if (cstr == 0) return string();
return string(cstr,pcount());
}
};
/*
* Only limited functionality from istringstream
* is implemented
*/
class istringstream : public istrstream {
public:
istringstream(const string& str)
: istrstream(str.c_str()) { }
};
}
#endif
If anyone has a solution for this please let me know.
Thanks,
Praveen.
I am trying to build a static library, while building the library i am
getting the following error:
fatal error C1189: #error : "No sstream/strstream implementation"
Following is the code that is giving error:
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#ifdef HAVE_SSTREAM
# include <sstream>
#elif HAVE_STRSTREAM
# define USE_STRSTREAM_WRAPPERS
#else
# error "No sstream/strstream implementation"
#endif
#if defined(USE_STRSTREAM_WRAPPERS) && !defined(SSTREAM_FIX_H)
#define SSTREAM_FIX_H
#include <string>
#include <strstream>
namespace std
{
/*
* Only limited functionality from ostringstream
* is implemented
*/
class ostringstream : public ostrstream {
public:
string str() {
char *cstr = ostrstream::str();
freeze(0);
if (cstr == 0) return string();
return string(cstr,pcount());
}
};
/*
* Only limited functionality from istringstream
* is implemented
*/
class istringstream : public istrstream {
public:
istringstream(const string& str)
: istrstream(str.c_str()) { }
};
}
#endif
If anyone has a solution for this please let me know.
Thanks,
Praveen.