[Insight-developers] Problems compiling under VC++ (and solution)

Parag Chandra chandra@cs.unc.edu
Mon, 2 Apr 2001 12:29:19 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0199_01C0BB70.8A6B1A20
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
For almost a week now, I've been getting the following errors whenever I =
try to compile any project I've ever created as part of the ITK =
workspace under VC++:

d:\development\insight\code\numerics\vxl\vcl\win32\vcl_complex.h(27) : =
error C2667: 'norm' : none of 2 overload have a best conversion
        d:\development\insight\code\numerics\vxl\vnl\vnl_complex.h(43) : =
see reference to function template instantiation 'float __cdecl =
abs(const class std::complex<float> &)' being compiled

These projects continue to compile and run under gcc platforms however, =
including Cygwin. The last time I updated was on Friday, and I even did =
a completely new checkout, but the problem persists under both Debug and =
Release configurations.=20

I believe I know what the problem is now. I was being lazy and opening =
up the entire std namespace via 'using namespace std'. Removing that =
line and using the namespace explicitly every time I use cout and endl =
fixes it. Hope this helps someone else, as I've wasted a good part of =
the last 5 days trying to figure it out ;-)

-Parag

------=_NextPart_000_0199_01C0BB70.8A6B1A20
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4611.1300" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>For almost a week now, I've been =
getting the=20
following errors whenever I try to compile any project I've ever created =
as part=20
of the ITK workspace under VC++:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>d:\development\insight\code\numerics\vxl\vcl\win32\vcl_complex.h=
(27) :=20
error C2667: 'norm' : none of 2 overload have a best=20
conversion<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
d:\development\insight\code\numerics\vxl\vnl\vnl_complex.h(43) : see =
reference=20
to function template instantiation 'float __cdecl abs(const class=20
std::complex&lt;float&gt; &amp;)' being compiled</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR></FONT><FONT face=3DArial =
size=3D2>These projects=20
continue to compile and run under gcc platforms however, including =
Cygwin. The=20
last time I updated was on Friday, and I even did a completely new =
checkout, but=20
the problem persists under both Debug and Release configurations. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I believe I know what the problem is =
now. I was=20
being lazy and opening up the entire std namespace via 'using namespace =
std'.=20
Removing that line and using the namespace explicitly every time I use =
cout and=20
endl fixes it. Hope this helps someone else, as I've wasted a good part =
of the=20
last 5 days trying to figure it out ;-)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Parag</FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_0199_01C0BB70.8A6B1A20--