[Insight-users] ITK+QT
Jon Haitz Legarreta
jhlegarreta at vicomtech.org
Fri Sep 14 03:53:02 EDT 2012
Dear Huier,
ITK and Qt are two independent libraries and work independently. Your
problem is not related to Qt.
It seems a project configuration error, related to the CMakeLists.txt. Make
sure in your project's CMake you are linking it (TARGET_LINK_LIBRARIES) to
the ITK_LIBRARIES.
Anyway, when compiling ITK, if you are compiling it as shared library, a
single dll is produced, ITKCommon.dll
Make sure you have the environment variable ITK_DIR pointing to the folder
where you have your ITKConfig.cmake, and make sure your program is using
this and not other versions.
Make sure you are providing CMake with the corresponding ITK_DIR path (same
as above).
Make sure you have compiled ITK for each configuration (debug, release,
etc.) you want to build your project for.
If you are not using CMake to configure your project, using it will be of
help in order to avoid these kind of errors.
You will proably find other related posts that may help you through the
process.
Kind regards,
JON HAITZ
On 14 September 2012 04:47, Hui Li <huili0918 at gmail.com> wrote:
> Hi,
> I am trying to use ITK in QT, but I encounter 7 errors by simply include a
> header.
>
> The header included is #include "itkImageFileReader.h"
>
> All the errors are related to itksys.lib, following is one of them.
>
> itksys.lib(SystemTools.obj):-1: error: LNK2019: unresolved external symbol
> "__declspec(dllimport) public: char const * __thiscall
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >::c_str(void)const " (
> __imp_?c_str@?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@QBEPBDXZ)
> referenced in function "public: static void __cdecl
> itksys::SystemTools::GetPath(class std::vector<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >,class std::allocator<class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> > > > &,char const *)" (
> ?GetPath at SystemTools@itksys@@SAXAAV?$vector at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@V?$allocator at V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@2@@std@@PBD at Z
> )
>
> I use cmake2.8.9+vs2010 to compile and build ITK. The only dll file I got
> is itkCommon.dll.
> And I have included the header path and all the lib file to my project.
>
> Could you help me solve the error?
>
> Thank you!
>
> Huier,
> Regards
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120914/978d9399/attachment-0001.htm>
More information about the Insight-users
mailing list