[Insight-developers] Multiple defined symbols : ifstream/ofst
ream : Examples/OperatingRoom
Miller, James V (CRD)
millerjv@crd.ge.com
Mon, 24 Sep 2001 11:17:51 -0400
The system building the examples is our Intel C++ system.
-----Original Message-----
From: Luis Ibanez [mailto:ibanez@choroid.cs.unc.edu]
Sent: Monday, September 24, 2001 11:11 AM
To: insight-Developers
Subject: [Insight-developers] Multiple defined symbols :
ifstream/ofstream : Examples/OperatingRoom
Hi,
Now that /Examples is being built is easier to
track some of the problems that only arise when
full applications are built.
The Dashboard is showing the error that originaly
motivated the creation of the itkFstream class.
The problem arises when std::ifstream or std::ofstream
are used in two or more different .cxx files that
later are linked together. std::ifstream and std::ofstream
are templated classes, typically instantiated over <char>
and <wchar> (this last one for supporting unicode).
It seems that the implicit instatiation mechanism
of VC++ generates the implemetation of these classes
several times (I guess one for each .cxx it is used in).
At linking time, these repeated implementations seems
to be colliding. We use to set the "/force" keyword
on Project/Settings/Link in order to force the linker
to create an executable in spite of the collisions
(hopping that the replicated implementations are
truly identical).
In an attempt to solve the problem, we typedefed
std::ifstream in the class itkShape3D, and called
IfstreamType, but that doesn't seems to be doing
the trick..
This is a VC++ specific problem. The same code is
compiling and running smoothly under Linux.
Any ideas ?
Thanks
Luis
_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers