Error: DCMTK needs stringstream or strstream type
Moderator: Moderator Team
Error: DCMTK needs stringstream or strstream type
Hi,
I am trying to compile my own program, which uses dcmtk, on Linux (SUSE 7.1).
I got the following error message and I do not understand what it means:
"/home/dcmtk-3.5.3/ofstd/include/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type"
I compile the DCMTK first, I built the dcmtk libraries following the instructions in INSTALL file.
I include "osconfig.h" as the first line of my source and header files.
My compiler version is gcc 2.95.3
I would appreciate any help to solve this problem...
Linnet
I am trying to compile my own program, which uses dcmtk, on Linux (SUSE 7.1).
I got the following error message and I do not understand what it means:
"/home/dcmtk-3.5.3/ofstd/include/ofstream.h:76:2: #error DCMTK needs stringstream or strstream type"
I compile the DCMTK first, I built the dcmtk libraries following the instructions in INSTALL file.
I include "osconfig.h" as the first line of my source and header files.
My compiler version is gcc 2.95.3
I would appreciate any help to solve this problem...
Linnet
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
The error message you see indicates that neither HAVE_SSTREAM nor HAVE_STRSTREAM are defined in cfunix.h, which would mean that something has gone severely wrong with the configure process. Re-run DCMTK's configure script, check for errors and inspect the cfunix.h header file that is produces by the configure process. DCMTK needs one string stream class, either the <sstream> or the <strstream> header or their .h counterparts need to be present and configure tests for the presence of these header files.
#error DCMTK needs stringstream or strstream type
Hello,Marco Eichelberg wrote:The error message you see indicates that neither HAVE_SSTREAM nor HAVE_STRSTREAM are defined in cfunix.h, which would mean that something has gone severely wrong with the configure process. Re-run DCMTK's configure script, check for errors and inspect the cfunix.h header file that is produces by the configure process. DCMTK needs one string stream class, either the <sstream> or the <strstream> header or their .h counterparts need to be present and configure tests for the presence of these header files.
I am just trying to use dcmtk on debian sarge with the following
small test file
#include <osconfig.h>
#include <stdio.h>
#include "dcmimage.h"
int main()
{
FILE *ppm = fopen("t.ppm","w");
DicomImage di = new DicomImage("t.dcm");
di.writePPM(ppm);
return 0;
}
and get the typical error messages
#error DCMTK needs stringstream or strstream type
#error Your C++ compiler cannot handle class templates
indicating that something is wrong with the cfunix.h.
I am using g++-4.0. I am compiling with
g++ -I/usr/include/dcmtk \
-I/usr/include/dcmtk/ofstd \
-I/usr/include/dcmtk/dcmimgle \
-I/usr/include/dcmtk/dcmdata \
t.cc 2>tmp.log
, so that the dmctk-headers are found.
./configure of dcmtmk created the following lines in cfunix.h
/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1
/* Define to 1 if you have the <sstream.h> header file. */
/* #undef HAVE_SSTREAM_H */
/* Define to 1 if you have the <strstream> header file. */
#define HAVE_STRSTREAM 1
/* Define to 1 if you have the <strstream.h> header file. */
/* #undef HAVE_STRSTREAM_H */
/* Define to 1 if you have the <strstrea.h> header file. */
/* #undef HAVE_STRSTREA_H */
Any help would be appreciated, thanks Andreas
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
It seems that you're mixing the old C++ includes and the C++ ANSI includes.
Try to replace with
using the current release 3.5.4 (otherwise omit "dcmtk/ofstd/"). Also see configure options --enable-std-includes and --disable-std-includes.
Btw, there are ready-to-use Debian packages of DCMTK.
Try to replace
Code: Select all
#include <stdio.h>
Code: Select all
#define INCLUDE_CSTDIO
#include "dcmtk/ofstd/ofstdinc.h"
Btw, there are ready-to-use Debian packages of DCMTK.
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
In addition, instead of usingyou should use the following instructions with the current version of DCMTK (3.5.4):This will permit compilation when you have installed the header files and libraries, e.g. to /usr/include and /usr/lib or /usr/local/include and /usr/local/lib, respectively.
Code: Select all
#include <osconfig.h>
#include "dcmimage.h"
Code: Select all
#include <dcmtk/config/osconfig.h>
#include <dcmtk/dcmimgle/dcmimage.h>
Who is online
Users browsing this forum: Ahrefs [Bot], Baidu [Spider] and 1 guest