[Insight-users] Re: question : std::basic_ofstream

Luis Ibanez luis.ibanez@kitware.com
Mon, 06 Jan 2003 11:29:41 -0500


Hi Liqin,


This ambiguos behavior is consequence of the
loosely mechanism used by VC++ to decide when
to use the ANSI stream classes.


It is usually resolved by making sure that the
*first* header included in your main application
.cxx file is

   #include <fstream>

( note the absence of ".h" )


Please let us know if you find further problems,


   Thanks


   Luis


-------------------------------------


Wang, Liqin wrote:

> Luis,
> 
> I was running your sample multi-resolution program and tried to read avw or meta image by using the imageFileReader object in class of "simpleappinputparser" as follow:
> 
> #include  <itkAVWImageIOFactory.h>
> 
> 
> inside the execute() function
> 
> itk::AVWImageIOFactory::RegisterOneFactory();   // for read avwImage
> 
> 
> I always got link errores:
> 
> MultiResMIRegistration.cxx
> Linking...
> msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in MultiResMIRegistra
> tion.obj
> msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::close(void)" (?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in MultiResMIRegistration.obj
> msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: bool __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::is_open(void)const " (?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ) already defined in MultiResMIRegistr
> ation.obj
> Debug/MultiResMIRegistration.exe : fatal error LNK1169: one or more multiply defined symbols found
> Error executing link.exe.
> 
> ALL_BUILD - 4 error(s), 0 warning(s)
> 
> 
> Would you like to let me know how I can solve this problem?
> 
> Thanks,
> 
> Liqin
> 
>