[Insight-users] Problems RawImageIO

Luis Ibanez luis.ibanez@kitware.com
Fri, 18 Oct 2002 11:52:42 -0400


Hi Reinhold,

The usual suspects for this error are:

1) If compilation modes are mixed in the same project.

    For example, compiling some .obj for Debug/Multithreading
    and others for Debug/SingleThreading.

    You may want to verify that all the .obj files are
    compiled with the same settings. This includes your
    wxWindows built.

2) VC++ has fuzzy rules to define whether the old or
    the new iostream specification should be used.

    The rule something of the sort:

    if #include <iostream.h> is found before #include <iostream>
        use the old libraries.
    else
        use the new libraries


    In this case the header involved seems to be <fstream>.

    So, please try to make sure that

        #include <fstream>

    is the first header included.  Note that this is
    done in the itkRawImageIO.h.

---

BTW is this a typo error in your email ?
or you are actually including itkDicomImageIO.h
in itkDicomImageIO.h .... ?


Please let us know if you find further problems,


   Thank

      Luis

================================================================

Reinhold Füreder wrote:
 >
...snip
> --------
> 3) RawImageIO (itkrawimageio.h):
> If I want to use RawImageIO (#include <itkRamImageIO.h>) the link error
> LNK2005 pops up. Now I use according to one mailinglist posting the compiler
> flag /FORCE:MULTIPLE to turn them into warnings. Of course, I have to admit,
> I use other libraries (e.g. wxWindows):
> 
> msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: void __thiscall
> std::basic_ifstream<char,struct std::char_traits<char> >::`vbase
> destructor'(void)"
> (??_D?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined
> in swRamImageIOIncludingFile.obj
> msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: void __thiscall
> std::basic_ifstream<char,struct std::char_traits<char> >::open(char const
> *,int)" (?open@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXPBDH@Z)
> already defined in swRamImageIOIncludingFile.
> obj
> ... (and so on)
> 
> The solely use of DicomImageIO doesn't make any problems and the difference
> in reference to the std::string staff is maybe just <string> vs. <string.h>?
> RawImageIO.h:
> #include <fstream>
> #include "itkImageIOBase.h"
> #include "itkIndex.h"
> #include "itkImageRegion.h"
> #include "itkPixelTraits.h"
> #include "itkByteSwapper.h"
> #include "itkVersion.h"
> #include <string>
> 
> DicomImageIO.h:
> #include "itkDicomImageIO.h"
> #include "itkExceptionObject.h"
> #include "itkByteSwapper.h"
> #include <iostream>
> #include <list>
> #include <string.h>
> #include <math.h>
> 
> Thanks,
>     Reinhold
> 
> ------------------------------
> University of Exeter
> School of Engineering and Computer Science
> Harrison Building
> North Park Road
> Exeter, EX4 4QF
> UK
> 
>