[Insight-users] Compiler Settings for using ITK in a VS2005 CLR project

Thomas Lambertz thomas at hexerei-software.de
Mon Apr 24 19:59:39 EDT 2006


Hello Mike,

the difference between C++/CLI and conventional unmanaged C++ is much 
more than only a compilerstep. For example there are no raw-pointer in 
CLI and there are many other types that have changed. So it doesnt work 
to set up a project for CLI by only changing some parameters in CMake. 
 From my point of view there´s no way to compile ITK as CLI without 
rewriting nearly the complete code (but i am prepared to learn). 
Resulting performance may be another contraindication.

Have you considered a mixedmode application ? I have approached it that 
way. My GUI runs as a CLI-app while access to ITK is encapsulated in an 
unmanaged DLL (you have to spent some attention on memory-management). 
Needs some work on a wrapper but the benefits of the new gui-handling 
may pay of for you.

Statically linking the (conventional) ITK library against a mixedmode 
application by using "#pragma (un)managed" and some marshalling may also 
work.I am sure there are more suitable solutions...

Regards,
Tom


Mike Feur wrote:
>  Hello,
>
>  I am trying to create a Common Language Runtime C++/CLI project that
>  includes ITK code in Visual Studio 2005.
>
>  There is no Cmake file for me to use.   I have tried manually copying
>  over all the include directories from a Cmake created ITK project.  I
>  am getting linker errors such as
>
>  "error LNK2001: unresolved external symbol "public: virtual void
>  __thiscall itk::EventObject::Print(class std::basic_ostream< ....."
>
>  I tried including the appropriate lib files by adding the
>  "...\InsightBin\bin\debug" directory to the  "Configuration
>  Properties\Linker\General\Additional Library Directories" dialog box
>  in the Property Pages for the Solution, but still no luck.
>
>
>  Any suggestions or instructions of how to integrate ITK into a CLR
>  solution?
>
>  Best of all would be a Cmake file to use, similar to the one
>  available for MFC.
>
>
>  Thanks for taking the time to read this.
>
t


More information about the Insight-users mailing list