[Insight-users] ITK 3.18 exception with VS9 but not mingw or during unit tests

Chuck Lloyd chuck.lloyd at gmail.com
Fri May 21 13:31:09 EDT 2010


Unfortunately this does not fix all the problems for vs9.

The same thing that works for vs8 gets further for vs9 but
still generates this error at link time for vtksys.

error LNK2019: unresolved external symbol "__declspec(dllimport)
public: class std::_String_iterator...

I found this page that seems to talk about it, but the fix didn't work for me.

http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/09ae5e38-8d81-4f3e-bfe8-e6250c31fca6

I'm digging in more now.


On Fri, May 21, 2010 at 11:15 AM, Chuck Lloyd <chuck.lloyd at gmail.com> wrote:
> Wes,
>
> Thanks a lot, that does in fact seem to solve my problem on my nmake vs8 builds.
> I will try to duplicate on the vs9 builds now and update.
>
> Now I need to figure out how to install both Debug and Release libs
> for development
> and release. Do you know? I know how boost handles it. I'm not sure of the
> proper ITK way.
>
> Chuck
>
> On Fri, May 21, 2010 at 9:58 AM, Wes Turner <wes.turner at kitware.com> wrote:
>> Let's see if I am understanding this correctly ... You have an ITK
>> installation that builds under VS 2008 and which passes (most) of the ITK
>> tests when ctest is run in the build directory.  When you create an external
>> project based on Image5.cxx and build that pointing to your ITK build, the
>> executable does not run.  Correct?
>> One quick question: Did you build your external project with the same
>> compiler settings as ITK (Debug/Debug or Release/Release, etc.)?  VS does
>> not like to mix release and debug in the same executable and strange errors
>> can result.
>> - Wes
>>
>> On Fri, May 21, 2010 at 9:43 AM, Chuck Lloyd <chuck.lloyd at gmail.com> wrote:
>>>
>>> Thanks for the quick response Bill.
>>>
>>> I deleted ITKCommon.dll from the dir and added C:\Program Files\ITK\bin
>>> to the path but I still get the same issue.
>>>
>>> I'm recompiling with 2005 to see if that makes a difference. I had a
>>> similar problem using nmake.
>>>
>>> I'm using a fairly vanilla config but I am trying to include the
>>> optimized kernel code. CMake reports these changes.
>>>
>>> -DITK_USE_REVIEW:BOOL="1" -DITK_USE_CONSOLIDATED_MORPHOLOGY:BOOL="1"
>>> -DBUILDNAME:STRING="Win32-vs8"
>>>
>>>
>>> On Fri, May 21, 2010 at 8:30 AM, Bill Lorensen <bill.lorensen at gmail.com>
>>> wrote:
>>> > I don't think you should be copying the dll. You should set your path
>>> > to the location of the dll.
>>> >
>>> > Bill
>>> >
>>> > On Thu, May 20, 2010 at 5:14 PM, Chuck Lloyd <chuck.lloyd at gmail.com>
>>> > wrote:
>>> >> I’m hoping someone can help. I’m not having a lot of luck tracking this
>>> >> down.
>>> >>
>>> >> Any program more complex than than HelloWorld.cxx, such as
>>> >> Examples\DataRepresentation\Image\Image5.cxx, will terminate
>>> >> with an exception when I run it. I’ve been able to duplicate the same
>>> >> behavior with Testing\Code\BasicFilters\itkImportImageTest.cxx.
>>> >>
>>> >> Here’s what I do.
>>> >>
>>> >> Get 3.18 zip of ITK.
>>> >> Unzip it.
>>> >> Make buildir
>>> >> Run CMAKE 2.8.1 to make a visual studio 2008 solution in builddir
>>> >> (Win32-vs9)
>>> >> Build ALL_BUILD
>>> >> Build RUN_TESTS (Only a few fail)
>>> >> Build Package
>>> >> Install Package
>>> >>
>>> >> Make simple dir with itkImportImageTest.cxx and simple CMakelists.txt
>>> >> from HelloWorld.cxx.
>>> >> Change itkImportImageTest() to main() in cxx file.
>>> >> Make solution (Point CMAKE at installed ITK)
>>> >> Build solution (Linker warning about adding /nodefaultlib:MSVCRT, but
>>> >> that doesn’t fix this either)
>>> >> Copy ITKCommon.dll from installation to Debug dir
>>> >> Run itkImportImageTest.exe in Debug dir.
>>> >> Get exception in some basic string operation in
>>> >> gdcm:DictSet:BuildDictPath
>>> >>
>>> >> This test passed when run from the RUN_TESTS target in the original
>>> >> build.
>>> >>
>>> >> This entire process works find  with the Mingw compiler that comes
>>> >> with QtCreator.
>>> >>
>>> >> I’m down to comparing the .vcproj files but that isn’t helping so far.
>>> >> I’m hoping someone can help.
>>> >>
>>> >> Chuck Lloyd
>>> >> Software Architect
>>> >> Reveal Imaging
>>> >> Chuck.Lloyd at revealimaging dot com
>>> >> _____________________________________
>>> >> 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.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
>>> >>
>>> >
>>> _____________________________________
>>> 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.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
>>
>>
>>
>> --
>> Wesley D. Turner, Ph.D.
>> Kitware, Inc.
>> Technical Leader
>> 28 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4920
>>
>


More information about the Insight-users mailing list