Error: DCMTK needs stringstream or strstream type

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

Error: DCMTK needs stringstream or strstream type

#1 Post by bydoingbylearn »

Hi,

I am trying to compile my own program, which uses dcmtk, on Windows7 .
I got the following error message and I do not understand what it means:

"/\include\dcmtk\ofstd\ofstream.h(80): fatal error C1189: #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 Visual Studio 2010


I would appreciate any help to solve this problem...

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Which version of the DCMTK are you using? The current version 3.6.0?

Have you already checked the corresponding source code line in "ofstd/include/dcmtk/ofstd/ofstream.h"? Are the relevant defines in "osconfig.h" really undefined?

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#3 Post by bydoingbylearn »

Jörg Riesmeier wrote:Which version of the DCMTK are you using? The current version 3.6.0?

Have you already checked the corresponding source code line in "ofstd/include/dcmtk/ofstd/ofstream.h"? Are the relevant defines in "osconfig.h" really undefined?
Yes,the version is 3.6.0.
In my view,there may be somthing wrong in the new DCMTK version 3.6.0,
especially the ofstream.h,Because when I compile the dcmtk with cmake there was something note was appeared . eg, some flie of ".h"was not found,but when I generated and compile the ".dsw" ,it was successed?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#4 Post by Jörg Riesmeier »

Are you sure that you've selected the correct Compiler in CMake? I'm asking this because for VisualStudio 2010 CMake usually creates ".sln" files instead of ".dsw" (and ".dsp").
Because when I compile the dcmtk with cmake there was something note was appeared . eg, some flie of ".h"was not found,but when I generated and compile the ".dsw" ,it was successed?
So, does that mean that DCMTK compiles without any problems?

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#5 Post by bydoingbylearn »

Jörg Riesmeier wrote:Are you sure that you've selected the correct Compiler in CMake? I'm asking this because for VisualStudio 2010 CMake usually creates ".sln" files instead of ".dsw" (and ".dsp").
Because when I compile the dcmtk with cmake there was something note was appeared . eg, some flie of ".h"was not found,but when I generated and compile the ".dsw" ,it was successed?
So, does that mean that DCMTK compiles without any problems?
Yes ,you are right ,it is really "sln".
It is some details when I cmake

Looking for strtoul - found
Looking for sysinfo
Looking for sysinfo - not found
Looking for tempnam
Looking for tempnam - found
Looking for tmpnam
Looking for tmpnam - found
Looking for uname
Looking for uname - not found
Looking for usleep
Looking for usleep - not found
Looking for waitpid
Looking for waitpid - not found
Looking for _findfirst
Looking for _findfirst - found
Looking for isinf
Looking for isinf - not found.
Looking for isnan
Looking for isnan - not found.
Looking for finite
Looking for finite - not found.
Looking for flock
Looking for flock - not found.
Looking for gethostbyname
Looking for gethostbyname - found
Looking for gethostid
Looking for gethostid - not found.
Looking for bzero
Looking for bzero - not found.
Looking for gethostname
Looking for gethostname - found
Looking for waitpid
Looking for waitpid - not found.
Looking for wait3
Looking for wait3 - not found.
Looking for usleep
Looking for usleep - not found.
Looking for accept
Looking for accept - found
Looking for bind
Looking for bind - found
Looking for getsockname
Looking for getsockname - found
Looking for getsockopt
Looking for getsockopt - found
Looking for setsockopt
Looking for setsockopt - found
Looking for socket
Looking for socket - found
Looking for listen
Looking for listen - found
Looking for std::vfprintf
Looking for std::vfprintf - found
Looking for std::vsnprintf
Looking for std::vsnprintf - not found.
It's the part of . and it's really vs2010.
thanks!!

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#6 Post by Jörg Riesmeier »

I'm sorry but where exactly is the problem when DCMTK compiles without problems? CMake is only used to create the project files for VisualStudio. If the configure/generate process is completed, CMake is not needed any more.

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#7 Post by bydoingbylearn »

Jörg Riesmeier wrote:I'm sorry but where exactly is the problem when DCMTK compiles without problems? CMake is only used to create the project files for VisualStudio. If the configure/generate process is completed, CMake is not needed any more.
May be some head files is wrong ,when compiling the dcmtk,the problem wasn't appeared,but use it to do some work ,the wrong appred, isn't it?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#8 Post by Jörg Riesmeier »

If the DCMTK compiles out-of-the-box (which should be the normal case on your platform), then there was apparently no problem with the CMake configuration (of DCMTK).
If you experience problems when creating your own application, then the reason is probably in your application / your CMake files. FAQ #47 explains how to use DCMTK in your own application (with CMake).

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#9 Post by bydoingbylearn »

Jörg Riesmeier wrote:If the DCMTK compiles out-of-the-box (which should be the normal case on your platform), then there was apparently no problem with the CMake configuration (of DCMTK).
If you experience problems when creating your own application, then the reason is probably in your application / your CMake files. FAQ #47 explains how to use DCMTK in your own application (with CMake).
oh,I am so appreciate for your help ! You do a lot for me to understand the dcmtk! And I think the dcmtk is not a easy problem!

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#10 Post by bydoingbylearn »

I want to tell you that my mother language wasn't English,So some meaning wasn't express well.

The first question was that "osconfig.h" was defferent after Cmake,so you should use the cmaked "osconfig.h"

And I want to ask you another question ,Whether PNG TIFF ZLIB and Openssl were must be ,when I Cmake ,I didn't set those value on.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#11 Post by Jörg Riesmeier »

The first question was that "osconfig.h" was defferent after Cmake,so you should use the cmaked "osconfig.h"
The "osconfig.h" that is used by DCMTK (and which should be used by your application) is created in the "include/dcmtk/config" directory - in the build directory, not in the source directory!
Whether PNG TIFF ZLIB and Openssl were must be ,when I Cmake ,I didn't set those value on.
As you can read in the INSTALL file, these external libraries are optional, i.e. you don't need them necessarily. You can find pre-compiled support libraries for Windows on the DCMTK homepage. If they are not found in the specified path (or the path is not specified at all), then these libraries are disabled automatically.

bydoingbylearn
Posts: 29
Joined: Mon, 2010-08-16, 10:01
Location: CHINA

#12 Post by bydoingbylearn »

Thank you for you help in those days ,with you help ,my work get a great progress!!
Best wishs for you!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest