v3.6.0 error C1083: Cannot open include file: 'iostream.h'

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

v3.6.0 error C1083: Cannot open include file: 'iostream.h'

#1 Post by kamil »

I find this error in "ofsteam.h", and I don't know how to solve this error, previous dcmtk version works well.

After I contrast "ofsteam.h" in previous version, I found there is a new inform:

Code: Select all

/* 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.
 */
I tried set "#define USING_STD_NAMESPACE" in my code, but didn't work.

OS: Win7 Home
VS version: VS2010

How to solve it? Thanks!

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#2 Post by kamil »

After I defined these macros:

Code: Select all

#define USE_STD_CXX_INCLUDES
#define HAVE_SSTREAM
#define USING_STD_NAMESPACE
#define HAVE_CLASS_TEMPLATE
#define HAVE_FUNCTION_TEMPLATE
It appears some new errors:

Code: Select all

1>h:\projects\dicomtest\converttoraw\dcmtk\oflog\helpers\property.h(57): warning C4800: 'OFBool' : forcing value to bool 'true' or 'false' (performance warning)
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(145): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(145): error C2146: syntax error : missing ';' before identifier 'fopen'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(223): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(223): error C2146: syntax error : missing ';' before identifier 'freopen'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(223): error C2660: 'OFFile::freopen' : function does not take 3 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(241): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(241): error C2146: syntax error : missing ';' before identifier 'tmpfile'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(269): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(269): error C2146: syntax error : missing ';' before identifier 'fclose'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(269): error C2660: 'OFFile::fclose' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(296): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(296): error C2146: syntax error : missing ';' before identifier 'fwrite'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(296): error C2660: 'OFFile::fwrite' : function does not take 4 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(312): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(312): error C2146: syntax error : missing ';' before identifier 'fread'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(312): error C2660: 'OFFile::fread' : function does not take 4 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(322): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(322): error C2146: syntax error : missing ';' before identifier 'fflush'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(322): error C2660: 'OFFile::fflush' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(331): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(331): error C2146: syntax error : missing ';' before identifier 'fgetc'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(331): error C2660: 'OFFile::fgetc' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(359): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(359): error C2146: syntax error : missing ';' before identifier 'rewind'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(359): error C2660: 'OFFile::rewind' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(363): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(363): error C2146: syntax error : missing ';' before identifier 'clearerr'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(363): error C2660: 'OFFile::clearerr' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(377): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(377): error C2146: syntax error : missing ';' before identifier 'feof'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(393): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(393): error C2146: syntax error : missing ';' before identifier 'ferror'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(422): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(422): error C2146: syntax error : missing ';' before identifier 'setbuf'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(422): error C2660: 'OFFile::setbuf' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(441): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(441): error C2146: syntax error : missing ';' before identifier 'setvbuf'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(441): error C2660: 'OFFile::setvbuf' : function does not take 4 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(473): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(473): error C2146: syntax error : missing ';' before identifier 'fputc'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(473): error C2660: 'OFFile::fputc' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(483): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(483): error C2146: syntax error : missing ';' before identifier 'fgets'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(483): error C2660: 'OFFile::fgets' : function does not take 3 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(489): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(489): error C2146: syntax error : missing ';' before identifier 'fputs'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(489): error C2660: 'OFFile::fputs' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(497): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(497): error C2146: syntax error : missing ';' before identifier 'ungetc'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(497): error C2660: 'OFFile::ungetc' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(524): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(524): error C2146: syntax error : missing ';' before identifier 'fflush'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(524): error C2660: 'OFFile::fflush' : function does not take 1 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(544): error C3861: '_fstat64': identifier not found
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(556): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(556): error C2146: syntax error : missing ')' before identifier 'fgetpos'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(556): error C2660: 'OFFile::fgetpos' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(556): error C2059: syntax error : ')'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(557): error C2143: syntax error : missing ';' before '{'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(633): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(633): error C2146: syntax error : missing ';' before identifier 'fgetpos'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(633): error C2660: 'OFFile::fgetpos' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(653): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(653): error C2146: syntax error : missing ';' before identifier 'fsetpos'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(653): error C2660: 'OFFile::fsetpos' : function does not take 2 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(669): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(669): error C2146: syntax error : missing ';' before identifier 'vfprintf'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(669): error C2660: 'OFFile::vfprintf' : function does not take 3 arguments
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(681): error C2065: 'STDIO_NAMESPACE' : undeclared identifier
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(681): error C2146: syntax error : missing ';' before identifier 'vfprintf'
1>h:\projects\dicomtest\converttoraw\dcmtk\ofstd\offile.h(681): error C2660: 'OFFile::vfprintf' : function does not take 3 arguments

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#3 Post by J. Riesmeier »

So, you are trying to compile DCMTK 3.6.0 with VisualStudio 2010 on a Windows 7 system, right? This should work out of the box since this was one of out test systems (see INSTALL file). There is nothing you need to set since everything should be done by the CMake configure process.

Or, are you trying to compile your own project?

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#4 Post by kamil »

J. Riesmeier wrote:So, you are trying to compile DCMTK 3.6.0 with VisualStudio 2010 on a Windows 7 system, right? This should work out of the box since this was one of out test systems (see INSTALL file). There is nothing you need to set since everything should be done by the CMake configure process.

Or, are you trying to compile your own project?
sorry, I forget to tell you I am trying to compile my own project using dcmdata lib for testing.
And my OS is win7 Home 64bit version.

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#5 Post by kamil »

Hi, I have tested in win7 ultimate 32bit version and the problem is still the same.
May I miss something new of configuration in cmake compared with 3.5.4?

kamil
Posts: 63
Joined: Fri, 2009-04-17, 09:18

#6 Post by kamil »

Hi, I have solved this problem.I find I have copied wrong "osconfig.h" which is from dcmtk source directory before cmake generation. After cmake generation, the correct "osconfig.h" file is in the new project "\include\dcmtk\config".

After cmake generation, it seems it creates some macros for the compiler of your system.

And I find the instruction in the Install file:

Code: Select all

Visual C++ contains two different implementations of I/O streams which
   should never be mixed within one application because this may cause
   application errors that are hard to find.  The old, now deprecated
   implementation uses the traditional cfront header files <iostream.h> etc.
   The new implementation uses <iostream> etc. as defined in ANSI/ISO C++.
   DCMTK can be configured to use either of the two interfaces.  This behaviour
   can be changed in "include/dcmtk/config/osconfig.h" in the build directory
   where the symbol USE_STD_CXX_INCLUDES is declared.
Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest