[Insight-users] building itk using visual studio 2010

Luis Ibanez luis.ibanez at kitware.com
Mon Apr 26 15:49:51 EDT 2010


Hi Xiaofeng,

It is now possible to build ITK with Visual Studio 10.


   Thanks a lot for contributing your fixes !


       This was a great example of
       the power of Open Source at work !     :-)


The relevant commits are the following:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itk_hashtable.h?root=Insight&r1=1.34&r2=1.35&sortby=date
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkMacro.h?root=Insight&r1=1.100&r2=1.101&sortby=date
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/Common/itkMesh.txx?root=Insight&r1=1.104&r2=1.105&sortby=date


The first green Experimental build from a Visual Studio 10
build has been posted to the ITK Dashboard at:

http://www.cdash.org/CDash/buildSummary.php?buildid=595426


Please update your CVS Checkout of ITK,
in order to get the working version.


Note that they are not yet the "correct" way of providing
support for Visual Studio 10.  In particular, the statements

         #if  defined( MSC_VER) ....

should be replaced by the proper TRY_COMPILE
equivalents.

We will be cleaning this up in the following days,
and moving the checks to the try_compile files in

Insight/CMake/
     itkTestFriendTemplatedFunction.cxx
     itkTestFriendTemplatedFunction.cmake



However,
in the meantime, you can start using ITK
with Visual Studio 10          :-)


   Please let us know if you find any issues.


We will let this marinate in the Dashboard for
a couple of days before we apply a patch to the
ITK 3.18 branch.



      Thanks


            Luis



---------------------------------------------------
On Thu, Apr 22, 2010 at 3:47 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

>
> Hi Xiaofeng,
>
>
>      Thanks for sharing your findings.
>
> Yes, you are in the right track.
>
> We are trying to figure our what will be the
> right definition of this macro (and others).
>
> So far, we have finding that we need to add
> some
>
>     #ifdef (_MSC_VER < 1600 )
>
>     #else
>        // Code for VS 10
>     #endif
>
> mostly for the lines that you are commenting
> out in itk_hashtable.h
>
>
>       Thanks
>
>
>            Luis
>
>
> --------------------------------------------------------------
>
> On Thu, Apr 22, 2010 at 2:59 PM, Xiaofeng Z <xf10036 at hotmail.com> wrote:
>
>>
>> I was able to derive a workaround to get ITK to compile by VS 2010.  This
>> involves changing a few source code files:
>>
>> 1. add "#define ITK_SUPPORTS_TEMPLATED_FRIEND_FUNCTION_WITH_NULL_STRING"
>> in "itkMacro.h" before line 750
>>
>> 2. comment out line 1148-1155 in file "itk_hashtable.h"
>>
>> 3. add "#include <iterator>" to "itkMesh.txx"
>>
>> Hope this helps!
>>
>>
>> Xiaofeng Z
>>
>>
>>
>>
>> ________________________________
>> > Date: Thu, 22 Apr 2010 11:15:40 -0400
>> > Subject: Re: [Insight-users] building itk using visual studio 2010
>> > From: luis.ibanez at kitware.com
>> > To: xf10036 at hotmail.com
>> > CC: mike.jackson at bluequartz.net; insight-users at itk.org
>> >
>> >
>> > Hi Xiaofeng,
>> >
>> > We are setting up a Nightly build of ITK with Visual Studio 10,
>> > that will post to the ITK Dashboard.
>> >
>> > http://www.cdash.org/CDash/index.php?project=Insight
>> >
>> >
>> > That will help us ensure that VS10 is supported, and that
>> > it remains supported on a permanent basis.
>> >
>> >
>> > Stay tunned....
>> >
>> >
>> > Regards,
>> >
>> >
>> > Luis
>> >
>> >
>> > --------------------------------------------------------------------
>> >
>> > On Thu, Apr 22, 2010 at 10:59 AM, Xiaofeng Z> wrote:
>> >
>> >
>> >
>> >
>> >
>> > Is there any workaround before a permanent solution is worked out?
>> >
>> >
>> >
>> >
>> >
>> > Xiaofeng Z
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > ----------------------------------------
>> >
>> >> CC: insight-users at itk.org
>> >
>> >> From: mike.jackson at bluequartz.net
>> >
>> >> To: xf10036 at hotmail.com
>> >
>> >> Subject: Re: [Insight-users] (no subject)
>> >
>> >> Date: Thu, 22 Apr 2010 10:15:08 -0400
>> >
>> >>
>> >
>> >> It seems that ITK 3.18 will NOT compile against VS 2010:
>> >
>> >>
>> >
>> >> From an April 19, 2010 Posting to this list from Luis Ibanez
>> >
>> >>> Hi Mostafizur,
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> ITK (any version) does not support Visual Studio 10 yet.
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> There were some structural changes made to Visual Studio 10,
>> >
>> >>> that require CMake to manage the configuration process in a
>> >
>> >>> way different from what is done with Visual Studio 9.
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> We will have Visual Studio 10 support for ITK in our top priorities
>> >
>> >>> for the development cycle of ITK 3.19.
>> >
>> >>>
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> Regards,
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> Luis
>> >
>> >>
>> >
>> >> --
>> >
>> >> Mike J.
>> >
>> >>
>> >
>> >> On Apr 22, 2010, at 10:01 AM, Xiaofeng Z wrote:
>> >
>> >>
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> Anyone able to compile itk in Visual Studio 2010? I'm getting large
>> >
>> >>> amount of errors. The first one is:
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> 50>d:\nyph\imaging\source\insighttoolkit-3.18.0\code\common
>> >
>> >>> \itk_hashtable.h(474): error C2146: syntax error : missing ';'
>> >
>> >>> before identifier 'ITK_FRIEND_TEMPLATE_FUNCTION_ARGUMENT'
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> Is there anything I need to change in CMake? The only thing I
>> >
>> >>> changed was to turn on BUILD_SHARED_LIBS.
>> >
>> >>>
>> >
>> >>> Thanks!
>> >
>> >>>
>> >
>> >>>
>> >
>> >>> Xiaofeng Z
>> >
>> >>> _________________________________________________________________
>> >
>> >>> The New Busy is not the old busy. Search, chat and e-mail from your
>> >
>> >>> inbox.
>> >
>> >>>
>> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
>> >
>> >
>> >>> _____________________________________
>> >
>> >>> 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
>> >
>> >>
>> >
>> > _________________________________________________________________
>> >
>> > The New Busy is not the old busy. Search, chat and e-mail from your
>> inbox.
>> >
>> >
>> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
>> >
>> >
>> > _____________________________________
>> >
>> > 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
>> >
>> >
>> _________________________________________________________________
>> Hotmail is redefining busy with tools for the New Busy. Get more from your
>> inbox.
>>
>> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100426/5a9fd370/attachment-0001.htm>


More information about the Insight-users mailing list