[Insight-developers] fstream instantiation

Bill Hoffman bill.hoffman@kitware.com
Mon, 09 Apr 2001 09:21:19 -0400


This is not because of vcl_fstream.h which just includes <fstream>.
It is more likely a problem with mismatched compiler flags.
Please see Insight/Documents/VC_Custom_Projects.doc and be careful with the compiler flags.
Microsoft puts linker commands into .obj files.  This is because there
are several versions of the microsoft c++ libraries:  rtti, execeptions, new streams,
old streams, threaded, not threaded.   And most combinations of those.
The result is that the compile flags must match.

-Bill

At 06:38 PM 4/8/2001 -0400, Luis Ibanez wrote:

>Hi,
>
>I'm building a project using Insight, and have trouble
>at link time with the definition of ifstream and ofstream.
>
>It is related with the fact that  ifstream/ofstream are now
>a typedefs for a template that can be instantiated with char or wchars.
>
>
>The message I got in VC++ is:
>
>Linking...
>OperatingRoomLib.lib(liSpineModel.obj) :
>warning LNK4006: "public: void __thiscall std::basic_ofstream<char,struc
>std::char_traits<char> >::`vbase destructor`(void)
>already defined in msvcprtd.lib(MSVCP60D.dll); second definition ignored
>
>..
>
>
>Is this related with the use of vcl_fstream.h  ?
>
>Is there any way to prevent my code (external to itk) to instantiate
>ifstream/ofstream ?
>
>
>Thanks
>
>
>
>Luis