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 » Fri, 2011-02-25, 09:01

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 » Fri, 2011-02-25, 11:16

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 » Sat, 2011-02-26, 11:17

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 » Sat, 2011-02-26, 18:06

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 » Sun, 2011-02-27, 05:26

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 » Sun, 2011-02-27, 21:51

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 » Mon, 2011-02-28, 02:23

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 » Mon, 2011-02-28, 08:41

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 » Tue, 2011-03-01, 02:31

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 » Tue, 2011-03-01, 02:49

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 » Tue, 2011-03-01, 09:06

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 » Wed, 2011-03-02, 03:29

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