Click here to Skip to main content
15,904,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i start to build the project the error

"error : DCMTK needs stringstream or strstream type
Generating Code"

occurs.

I have given the proper path for dcmtk\ofstd\ofstream.h then also i am unable to build the project.Please help me out so that i can build and compile the project. Thanks
Nitin

<pre><pre><small></small>
Posted
Comments
Sergey Alexandrovich Kryukov 21-Apr-11 2:25am    
OK, a spectacular failure to format code. Make sure if is rendered properly after you post.
--SA
nitin_Pandharpatte 21-Apr-11 2:31am    
I did not get you. thanks for reply
Sergey Alexandrovich Kryukov 21-Apr-11 3:00am    
Do you see empty yellowish band and another one with HTML garbage?
What did you mean to place there? Must be some code.
Fix it so we could see it.
--SA
CPallini 21-Apr-11 2:47am    
You should elaborate a bit. Maybe you should post the relevant code.
nitin_Pandharpatte 21-Apr-11 9:00am    
the code is



#ifndef OFSTREAM_H
#define OFSTREAM_H

#include "dcmtk/config/osconfig.h"

#ifdef USE_STD_CXX_INCLUDES

#include <iostream>
#ifdef HAVE_IOS
#include <ios>
#endif
#include <fstream>
#include <iomanip>
// For standard STREAMS library: preference for standard stringstream
#if defined(HAVE_SSTREAM)
#include <sstream>
#define USE_STRINGSTREAM
#elif defined(HAVE_STRSTREAM)
#include <strstream>
#else
#error DCMTK needs stringstream or strstream type
#endif

/* DCMTK by default does not anymore pollute the default namespace by
* importing namespace std. Earlier releases did this to simplify compatibility
* with older compilers where STL classes were not consistently defined
* in namespace std. We now have configure macros which should care for this.
* If user code still relies on namespace std to be included, compile with
* macro USING_STD_NAMESPACE defined.
*/
#ifdef USING_STD_NAMESPACE
namespace std { }
using namespace std;
#endif

#else /* USE_STD_CXX_INCLUDES */

#include <iostream.h>
#include <fstream.h>
// For old STREAMS library: preference for strstream
#if defined(HAVE_STRSTREA_H) || defined(HAVE_STRSTREAM_H)
#ifdef HAVE_STRSTREA_H
#include <strstream.h>
#else
#include <strstream.h>
#endif
#elif defined(HAVE_SSTREAM_H)
#include <sstream.h>
#define USE_STRINGSTREAM
#else
#error DCMTK needs stringstream or strstream type
#endif

#include <iomanip.h>

#endif

#ifdef USE_STRINGSTREAM

// define STD_NAMESPACE to std:: if the standard namespace exists
#ifndef STD_NAMESPACE
#ifdef HAVE_STD_NAMESPACE
#define STD_NAMESPACE std::
#else
#define STD_NAMESPACE
#endif
#endif

#define OFendl STD_NAMESPACE endl

typedef STD_NAMESPACE stringstream OFStringStream;
typedef STD_NAMESPACE ostringstream OFOStringStream;
typedef STD_NAMESPACE istringstream OFIStringStream;

#define OFStringStream_ends ""
#define OFSTRINGSTREAM_GETOFSTRING(oss, string) \
OFString string((oss).str().c_str());
// The following two macros define a block structure. Please note that variables
// declared between xxx_GETSTR and xxx_FREESTR are only valid within this scope.
#define OFSTRINGSTREAM_GETSTR(oss, chptr) \
{ \
STD_NAMESPACE string chptr##__ = (oss).str(); \
const char *chptr = chptr##__.c_str();
#define OFSTRINGSTREAM_FREESTR(chptr) \
}

#else /* USE_STRINGSTREAM */

typedef strstream OFStringStream;
typedef ostrstream OFOStringStream;
typedef istrstream OFIStringStream;

#define OFStringStream_ends ends
#define OFSTRINGSTREAM_GETOFSTRING(oss, string) \
char * string##__ = (oss).str(); \
OFString string(string##__); \
delete[] string##__;
// The following two macros define a block structure. Please note that variables
// declared between xxx_GETSTR and xxx_FREESTR are only valid within this scope.
#define OFSTRINGSTREAM_GETSTR(oss, chptr) \
{ \
const char *chptr = (oss).str();
#define OFSTRINGSTREAM_FREESTR(chptr) \
delete[] (char *)chptr; \
}

#endif /* USE_STRINGSTREAM */

#endif /* USE_STD_CXX_INCLUDES */

http://godzilla.kennedykrieger.org/sw/dcmtk-3.5.4-html-help/ofstream_8h-source.html
goto this link
 
Share this answer
 
Make sure that you always #include "osconfig.h" before you include any other DCMTK header file. Also, make sure that the compiler does not find another version of "osconfig.h" or "cfunix.h". Both would explain the error message.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900