ofstream.h Cannot open include file: 'iostream.h': No such f

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
loveDcmtk
Posts: 5
Joined: Fri, 2012-05-25, 07:47

ofstream.h Cannot open include file: 'iostream.h': No such f

#1 Post by loveDcmtk »

Hello,

I use DCMTK 3.6.0 and Microsoft Visual Studio 2005 on a on a Windows Xp system.
I compiled DCMTK using CMAKE 2.8.8
I am trying to compile my own project and I had compilation errors:

ofstream.h(67) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory

how to correct this error?
thank you

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

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#2 Post by J. Riesmeier »

Are you mixing the two different implementations of I/O streams that are contained in the MS VS compilers? Is USE_STD_CXX_INCLUDES defined in your "dcmtk/config/osconfig.h" include file?

loveDcmtk
Posts: 5
Joined: Fri, 2012-05-25, 07:47

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#3 Post by loveDcmtk »

J. Riesmeier wrote:Are you mixing the two different implementations of I/O streams that are contained in the MS VS compilers?
I have no idea but I think that's the problem
J. Riesmeier wrote:Is USE_STD_CXX_INCLUDES defined in your "dcmtk/config/osconfig.h" include file?
Yes USE_STD_CXX_INCLUDES is defined in dcmtk/config/osconfig.h

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

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#4 Post by J. Riesmeier »

Then you are probably including DCMTK headers in your source files without including "dcmtk/config/osconfig.h" at the very beginning of these files.

Code: Select all

#include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
#include "<some other DCMTK header file>"

loveDcmtk
Posts: 5
Joined: Fri, 2012-05-25, 07:47

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#5 Post by loveDcmtk »

J. Riesmeier wrote:Then you are probably including DCMTK headers in your source files without including "dcmtk/config/osconfig.h" at the very beginning of these files.
NO

I'm including DCMTK headers like this :

Code: Select all

//Include Files for JpegLosless Version 2
#include "dcmtk/config/osconfig.h"
#include "dcmtk/ofstd/ofstdinc.h"

#include "dcmtk/dcmdata/dctk.h"
#include "dcmtk/dcmdata/dcostrma.h"
#include "dcmtk/dcmdata/dcitem.h"
#include "dcmtk/dcmdata/cmdlnarg.h"
#include "dcmtk/ofstd/ofconapp.h"
#include "dcmtk/dcmdata/dcuid.h"     /* for dcmtk version name */
#include "dcmtk/dcmjpeg/djdecode.h"  /* for dcmjpeg decoders */
#include "dcmtk/dcmjpeg/djencode.h"  /* for dcmjpeg encoders */
#include "dcmtk/dcmjpeg/djrplol.h"   /* for DJ_RPLossless */
#include "dcmtk/dcmjpeg/djrploss.h"  /* for DJ_RPLossy */
#include "dcmtk/dcmjpeg/dipijpeg.h"  /* for dcmimage JPEG plugin */
#include "dcmtk/dcmimage/diregist.h"  /* include to support color images */

#include "dcmtk/dcmdata/dcrledrg.h"  /* for DcmRLEDecoderRegistration */

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

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#6 Post by J. Riesmeier »

Why are you including "dcmtk/ofstd/ofstdinc.h" without defining any INCLUDE_xxx macro before this particular line? Basically, this should do nothing ... (look into the file).

loveDcmtk
Posts: 5
Joined: Fri, 2012-05-25, 07:47

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#7 Post by loveDcmtk »

I I removed the "dcmtk/ofstd/ofstdinc.h"
but I still have the error
ofstream.h(67) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#8 Post by Chung-Yueh Lien »

Please try to check "Ignore standard include path" is checked in project settings->C++->preprocessor.

loveDcmtk
Posts: 5
Joined: Fri, 2012-05-25, 07:47

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#9 Post by loveDcmtk »

When building DCMTK ?

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#10 Post by Chung-Yueh Lien »

loveDcmtk wrote:When building DCMTK ?
Both methods could be reliable:
1. Modify in Visual Studio manually.
1. CMake: set_target_properties( target PROPERTIES COMPILE_FLAGS “/X" )

oxymoron
Posts: 17
Joined: Wed, 2006-08-02, 16:40

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#11 Post by oxymoron »

Hi everybody, I have just the same problem and it begun when updating my code from version 3.5.5 _xxx to 3.6.0. I compiled DCMTK with CMake 2.8.10.2 and after compiling I got that "fatal error C1083: cannot open include file: 'iostream.h'" message. I´m developing on VS2008 and Windows XP-32. I´ve tried the solutions posted by Mr Riesmeier and Chung but still have the same error.As a side note, if I redirect the include files´search back to 3.5.5 it compiles OK.
Can you give me a hint of what I´m doing wrong? Thanks.

Chung-Yueh Lien
Posts: 61
Joined: Wed, 2010-05-19, 09:27
Location: Taipei, Taiwan

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#12 Post by Chung-Yueh Lien »

Since VS 6 or latest version is looking for <iostream>, instead of <iostream.h>. Otherwise, you can define HAVE_STD_NAMESPACE in "dcmtk/config/osconfig.h".
Another way is to change the line in "dcmtk\ofstd\ofstream.h"

Code: Select all

#include <iostream.h>
to

Code: Select all

#include <iostream>
However, the second method I did not test yet.

oxymoron
Posts: 17
Joined: Wed, 2006-08-02, 16:40

Re: ofstream.h Cannot open include file: 'iostream.h': No su

#13 Post by oxymoron »

I finally found the reason of this error, it seems that the CMake version I´m using stores osconfig.h in a different directory than the older version I used, that is "%DCMTKROOT%\include" and left some standard almost empty osconfig.h in "%DCMTKROOT%\config\include", that was where the former CMake version put it.
I don´t know if I misconfigured CMake or it´s the expected behaviour.
Thanks a lot.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest