[Insight-users] Building DCMTK VS2010 for ITK with CMAKE error LNK 2001, 2005, 2038

Matt McCormick matt.mccormick at kitware.com
Fri Oct 11 11:01:11 EDT 2013


Hi Jose,

In my experience, building multiple Visual Studio build types
(Release, Debug, etc) in the same build tree, and especially in the
same install tree, is not very reliable.

After opening the Visual Studio IDE, there is a drop down tab on the
top that allows selection of the build configuration.  Another option
is to restrict the number of Visual Studio build configurations that
CMake generates -- this is controlled by the CMAKE_CONFIGURATION_TYPES
CMake variable at CMake configure time.

HTH,
Matt

On Fri, Oct 11, 2013 at 2:34 PM, Jose Ignacio Prieto
<joseignacio.prieto at gmail.com> wrote:
> Sorry I didnt get it completely. I have to build normal ITK enabling this
> cmakelist somewhere, or I have to open CMake and try to build this
> CmakeLists in WindowsBuild and then build ITK??
> Thanks
>
>
> On Fri, Oct 11, 2013 at 11:16 AM, Williams, Norman K
> <norman-k-williams at uiowa.edu> wrote:
>>
>> You might ought to look at
>> ITK/Modules/ThirdParty/DCMTK/WindowsBuild/CMakeLists.txt
>>
>> I find working on Windows to be excruciating for exactly the reasons that
>> cause your problems; there has to be PERFECT agreement between a VS
>> project with the build flags of ALL libraries to which it links.
>> It's a little annoying on Linux/OS X that you have to rebuild everything
>> to go between Debug and Release, but there's no problem with linking
>> Release libraries into a Debug application.
>>
>> --
>> Kent Williams norman-k-williams at uiowa.edu
>>
>>
>>
>>
>>
>>
>> On 10/10/13 3:52 PM, "Jose Ignacio Prieto" <joseignacio.prieto at gmail.com>
>>
>> wrote:
>>
>> >Hi All,
>> >I know this is a DCMTK issue rather than ITK, but maybe some of you have
>> >tried this (and experienced the frustration).
>> >I was developing in linux using both libs but I had to move to windows
>> >because of a third lib. I haven't been able to build correctly my project
>> >now.
>> >I am using DCMTK and ITK head.
>> >1. First I generate DCMTK project with cmake. I set folder "A" for git
>> >source, "B" for build code and "C" for install, in a tree like c:\A c:\B
>> >c:\C. Then configure for build type Debug;Release, generate using MSVC 10
>> >x64 native compiler.
>> >2. Configure and generate using default conf.
>> >3. In VS2010 I build entire solution in debug, then build "install", then
>> >build entire solution in release, then build "install"
>> >4. I configure ITK, setting on ITK_USE_DCMTK and ITK_USE_IODCMTK, then
>> >USE_SYSTEM_DCMTK, reconfigure and point to previous folder c:\B
>> >5. Generate
>> >6. In VS2010 I build entire ITK solution in debug, then build "install",
>> >then build entire ITK solution in release, then build "install"
>> >
>> >7. I run cmake for my own project ( that already worked on linux). On
>> >that CMakeLists I don't have any reference to DCMTK, but when I check the
>> >includes in the .h files I can see the dcmtk code.
>> >
>> >
>> >I had about 25 errors LKN2001 and LNK2019. I could read that it was
>> >something on the order of the libraries link:
>> >
>> >
>> >, I tried to add ofstd on top of the classes I use. Didn't work. I read
>> >on some forum that there could be a difference setting off
>> >DCMTK_OVERWRITE_WIN32_COMPILER_FLAGS
>> >  df but it showed about 160 LNK2038 errors:
>> >dcmjpeg.lib(djdecode.obj):-1: error: LNK2038: mismatch detected for
>> >'_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in
>> >epxMainWindow.cxx.obj
>> >
>> >
>> >
>> >
>> >http://forum.dcmtk.org/viewtopic.php?t=1285
>> >
>> >http://www.itk.org/pipermail/insight-developers/2013-February/022462.html
>> >
>> >http://forum.dcmtk.org/viewtopic.php?f=4&t=35
>> >
>> >http://forum.dcmtk.org/viewtopic.php?f=4&t=36
>> >
>> >
>> >
>> >I don't know what else to try,
>> >
>> >
>> >Thanks
>> >
>> >
>> >
>> >--
>> >José Ignacio Prieto
>> >celular(nuevo): 94348182
>> >
>>
>>
>>
>> ________________________________
>> Notice: This UI Health Care e-mail (including attachments) is covered by
>> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
>> confidential and may be legally privileged.  If you are not the intended
>> recipient, you are hereby notified that any retention, dissemination,
>> distribution, or copying of this communication is strictly prohibited.
>> Please reply to the sender that you have received the message in error, then
>> delete it.  Thank you.
>> ________________________________
>
>
>
>
> --
> José Ignacio Prieto
> celular(nuevo): 94348182
>
> _____________________________________
> 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
>


More information about the Insight-users mailing list