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

Koen Van Leemput koen . vanleemput at hus . fi
Fri, 16 May 2003 10:31:51 +0300


On Thursday 15 May 2003 19:25, Parag Chandra wrote:
> 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:
>
>
>
>     m_Files.push_back(data.name);
>
>


Hi,  

I never played with ITK_AUTOLOAD_PATH, but I did copy some code from 
itkObjectFactoryBase some time ago into my own software and got exactly the 
same problem. 

As it turned out, the line 

Directory* dir = Directory::New();

in itkObjectFactoryBase::LoadLibrariesInPath(const char*) should use a smart 
pointer instead, i.e.

Directory::Pointer dir = Directory::New();

Hope this helps,

- Koen


-- 
***************************************************************************** 
Koen Van Leemput, Ph.D.                email : koen.vanleemput@hus.fi 
Department of Radiology                  phone: +358 9 471 76630        
Helsinki University Central Hospital   mobile: +358 50 42 72300        
P.O. Box 340                                  fax:      +358 9 471 71342        
FIN-00029 HUS                                                                           
FINLAND                                                                                    
*****************************************************************************