<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Probably too late for JX, but I found a solution. When configuring ITK with CMake, in the field CMAKE_CXX_FLAGS add the following: /D_ALLOW_KEYWORD_MACROS</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Article which helped me: <a href="http://mostlybuggy.wordpress.com/2012/12/18/getting-around-vs2012-c1189c4005-keyword-re-defined-in-macros/">http://mostlybuggy.wordpress.com/2012/12/18/getting-around-vs2012-c1189c4005-keyword-re-defined-in-macros/</a></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 29, 2013 at 9:33 AM, Bradley Lowekamp <span dir="ltr"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Why no upgrade to ITK v4?<br>
<br>
ITK v3.20 was released in 2010, well before Visual Studio 2012. So it should be no surprise it does not work with it. I believe VS 2010 should work with it, and VS9, and VS8, and VS7....<br>
<br>
<br>
Brad<br>
<div><div class="h5"><br>
<br>
<br>
On May 28, 2013, at 10:41 PM, JX NIE <<a href="mailto:njx937@gmail.com">njx937@gmail.com</a>> wrote:<br>
<br>
> Hi Everyone,<br>
> I have tried to compile ITK(version 3.20.1 ) with VS2012, but failed.<br>
> It has ended up with a lot of Redifine errors as follow.<br>
> Could you please tell me how to solve this compile problem.<br>
> Regards,<br>
><br>
> NIE JUNXIAO<br>
><br>
><br>
> >C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xkeycheck.h(242): fatal error C1189: #error : The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.<br>
><br>
> 1 IntelliSense: #error directive: The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro. c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\xkeycheck.h 242<br>
> 2 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\sal.h 2367<br>
> 3 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\vadefs.h 139<br>
> 4 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 437<br>
> 5 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 446<br>
> 6 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 464<br>
> 7 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 475<br>
> 8 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 476<br>
> 9 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 497<br>
> 10 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 501<br>
> 11 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 506<br>
> 12 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 514<br>
> 13 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 571<br>
> 14 IntelliSense: attribute "noreturn" does not apply here c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 572<br>
> 15 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 572<br>
> 16 IntelliSense: attribute "noreturn" does not apply here c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 575<br>
> 17 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 576<br>
> 18 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1979<br>
> 19 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1980<br>
> 20 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1981<br>
> 21 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1982<br>
> 22 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1983<br>
> 23 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1985<br>
> 24 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1992<br>
> 25 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 1999<br>
> 26 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\crtdefs.h 2023<br>
> 27 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 510<br>
> 28 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 528<br>
> 29 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 529<br>
> 30 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 542<br>
> 31 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 576<br>
> 32 IntelliSense: invalid destructor declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 577<br>
> 33 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 583<br>
> 34 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 585<br>
> 35 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 586<br>
> 36 IntelliSense: explicit type is missing ('int' assumed) c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 588<br>
> 37 IntelliSense: identifier "EMIT" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 588<br>
> 38 IntelliSense: function "_Lockit" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 589<br>
> 39 IntelliSense: reference variable "EMIT" requires an initializer c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 589<br>
> 40 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 591<br>
> 41 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 606<br>
> 42 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 693<br>
> 43 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 726<br>
> 44 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 729<br>
> 45 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 740<br>
> 46 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\yvals.h 741<br>
> 47 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 23<br>
> 48 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 47<br>
> 49 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 48<br>
> 50 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 49<br>
> 51 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 50<br>
> 52 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 54<br>
> 53 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 56<br>
> 54 IntelliSense: variable "memcpy_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 56<br>
> 55 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 56<br>
> 56 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 93<br>
> 57 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 97<br>
> 58 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 98<br>
> 59 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 103<br>
> 60 IntelliSense: variable "_strset_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 103<br>
> 61 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 103<br>
> 62 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 104<br>
> 63 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 107<br>
> 64 IntelliSense: variable "strcpy_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 107<br>
> 65 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 107<br>
> 66 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 109<br>
> 67 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 112<br>
> 68 IntelliSense: variable "strcat_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 112<br>
> 69 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 112<br>
> 70 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 114<br>
> 71 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 116<br>
> 72 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 117<br>
> 73 IntelliSense: variable "strnlen" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 121<br>
> 74 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 121<br>
> 75 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 123<br>
> 76 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 135<br>
> 77 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 142<br>
> 78 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 148<br>
> 79 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 149<br>
> 80 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 150<br>
> 81 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 151<br>
> 82 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 152<br>
> 83 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 153<br>
> 84 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 154<br>
> 85 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 155<br>
> 86 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 156<br>
> 87 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 157<br>
> 88 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 158<br>
> 89 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 159<br>
> 90 IntelliSense: variable "strcspn" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 160<br>
> 91 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 160<br>
> 92 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 161<br>
> 93 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 162<br>
> 94 IntelliSense: variable "_strerror_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 162<br>
> 95 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 162<br>
> 96 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 163<br>
> 97 IntelliSense: identifier "errno_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 166<br>
> 98 IntelliSense: variable "strerror_s" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 166<br>
> 99 IntelliSense: expected a ')' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 166<br>
> 100 IntelliSense: variable "EMIT" is not a type name c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\string.h 168<br>
><br>
</div></div>> <CMakeCache.txt>_____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div></div>