[Insight-users] How to extend ITK with DLLs at runtime? Defining ITK_AUTOLOAD_PATH crashes every program!

Parag Chandra pchandra at radonc . unc . edu
Thu, 15 May 2003 12:25:53 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C31ADD.21289C30
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Thanks for your help Gavin. But now as soon as I define =
ITK_AUTOLOAD_PATH,
every program that I've written that links against ITK dies unexpectedly
inside itk::Directory::Load(). Specifically, at the following line =
inside
the do loop:

=20

    m_Files.push_back(data.name);

=20

I even loaded up the original ITK workspace and tried out the simple =
Image1
example; it too dies at the same location. As soon as I undefine
ITK_AUTOLOAD_PATH, everything works again. I'm not really sure what's =
going
on, because data is completely defined, and data.name is set to '.', =
which
makes sense since that and '..' are the first two entries in any =
directory.
So something goes wrong with the insertion: as I step into
VECTOR::insert(iterator, size_type, const _Ty&), it tries to execute
_Ufill(_Last, _M - (_Last - _P), _X); and dies right there. I really =
can't
make any sense of that; has anyone else encountered this problem when
defining ITK_AUTOLOAD_PATH? I'm running WinXP Pro SP1, MSVC6 with the =
latest
service pack applied (SP5?), VTK 4.2, ITK 1.2, Cmake 1.6.6. The only =
thing
that comes to mind is I had to enable USE_ANSI_STDLIB (or something like
that) when configuring VTK/ITK in order to make ITK and VTK compatible =
with
each other. Would that be the cause?

=20

Best regards,

-Parag=20

=20


------=_NextPart_000_0004_01C31ADD.21289C30
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>Thanks for your =
help Gavin.
But now as soon as I define ITK_AUTOLOAD_PATH, every program that I've =
written
that links against ITK dies unexpectedly inside itk::Directory::Load().
Specifically, at the following line inside the do =
loop:</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>&nbsp;&nbsp;&nbsp; =
m_Files.push_back(data.name);</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>I even loaded up =
the
original ITK workspace and tried out the simple Image1 example; it too =
dies at
the same location. As soon as I undefine ITK_AUTOLOAD_PATH, everything =
works
again. I'm not really sure what's going on, because data is completely =
defined,
and data.name is set to '.', which makes sense since that and '..' are =
the
first two entries in any directory. So something goes wrong with the =
insertion:
as I step into VECTOR::insert(iterator, size_type, const _Ty&amp;), it =
tries to
execute _Ufill(_Last, _M - (_Last - _P), _X); and dies right there. I =
really
can't make any sense of that; has anyone else encountered this problem =
when
defining ITK_AUTOLOAD_PATH? I'm running WinXP Pro SP1, MSVC6 with the =
latest
service pack applied (SP5?), VTK 4.2, ITK 1.2, Cmake 1.6.6. The only =
thing that
comes to mind is I had to enable USE_ANSI_STDLIB (or something like =
that) when
configuring VTK/ITK in order to make ITK and VTK compatible with each =
other.
Would that be the cause?</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'>&nbsp;</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>Best =
regards,</span></font></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><font size=3D2 =
face=3D"Courier New"><span
style=3D'font-size:10.0pt;font-family:"Courier New"'>-Parag =
</span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;</span></font></p>

</div>

</body>

</html>

------=_NextPart_000_0004_01C31ADD.21289C30--