[Insight-users] Link error when trying to use Itk with Visual Studio 2005

Bill Lorensen bill.lorensen at gmail.com
Mon Oct 5 09:05:52 EDT 2009


Are you using CMake to configure your application?

On Mon, Oct 5, 2009 at 8:10 AM, Daanen Vincent <daanen at koelis.com> wrote:
> Dear all,
>
> I'm planning to use Itk into image-guided surgery application. I'm
> developping on a Win-Xp 32 bits box with Visual Studio 2005 (and I'm using
> MFC).
> I built itk (3.16) in Debug/release configuration, both in the shared and
> static librairies.
>
> I then designed and developped components to interface our own librairies
> with itk. When linking, I get the following linker errors (I just pout some
> of them because there are >30 errors):
> 1>ITKCommon.lib(itkExceptionObject.obj) : error LNK2019: symbole externe non
> résolu "__declspec(dllimport) public: __thiscall
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >(struct
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >::_Has_debug_it)"
> (__imp_??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at U
> _Has_debug_it at 01@@Z) référencé dans la fonction "public: virtual void
> __thiscall itk::ExceptionObject::SetLocation(char const *)"
> (?SetLocation at ExceptionObject@itk@@UAEXPBD at Z)
> 1>ITKCommon.lib(itkObjectFactoryBase.obj) : error LNK2001: symbole externe
> non résolu "__declspec(dllimport) public: __thiscall
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >::basic_string<char,struct
> std::char_traits<char>,class std::allocator<char> >(struct
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >::_Has_debug_it)"
> (__imp_??0?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QAE at U
> _Has_debug_it at 01@@Z)
>
> Linkers errors are due to std::basic_string (as above) (std::basic_istream,
> std::basic_ostream, std::complex).
>
> I checked the following things:
>  - I do not mix release/debug librairies
>  - I do have the same errors either with static or shared librairies
>  - Itk is built with MBCS support, not unicode.
>  - I also tried to build itk with "Use MFC static lib" option (instead of
> "Use standard windows librairies") and I have the same errors.
>
> So What should I check/do/build to use itk in my own application ?
>
> Thanks for any help
>
> Vincent
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list