<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Tim,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">it is a known bug in VS2017. Earlier <a href="http://itk-users.7.n7.nabble.com/ITK-users-ITK-Python-numpy-to-itk-image-and-viceversa-tp38067p38101.html">report</a> on ITK list, and <a href="http://itk-users.7.n7.nabble.com/ITK-users-ITK-Python-numpy-to-itk-image-and-viceversa-tp38067p38106.html">link</a> to bug.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default"><font face="verdana, sans-serif">Dženan Zukić, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.)</font></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 6, 2017 at 11:20 AM, Timothee Evain <span dir="ltr"><<a href="mailto:tevain@telecom-paristech.fr" target="_blank">tevain@telecom-paristech.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
I'm trying to compile ITK 4.11 with python wrapping through VisualStudio 2017.<br>
Build fails because every itk*CastXML and itk*Swig projects trigger a bunch of errors related to the xstring file of visual studio like this:<br>
<br>
[...]<br>
Error G3F63BFAE constexpr variable '_Memcpy_move_offset' must be initialized by a constant expression ITKSpatialObjectsCastXML C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\<wbr>Tools\MSVC\14.10.25017\<wbr>include\xstring 1905<br>
Error G3F63BFAE constexpr variable '_Memcpy_move_size' must be initialized by a constant expression ITKSpatialObjectsCastXML C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\<wbr>Tools\MSVC\14.10.25017\<wbr>include\xstring 1906<br>
[...]<br>
<br>
more detailed as:<br>
<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\xstring(1905,26): error G3F63BFAE: constexpr variable '_Memcpy_move_offset' must be initialized by a constant expression<br>
4> static constexpr size_t _Memcpy_move_offset = offsetof(_Mydata_t, _Bx);<br>
4> ^ ~~~~~~~~~~~~~~~~~~~~~~~~<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\stdexcept:23:21: note: in instantiation of template class 'std::basic_string<char, std::char_traits<char>, std::allocator<char> >' requested here<br>
4> : _Mybase(_Message.c_str())<br>
4> ^<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\xstring:1905:48: note: cast that performs the conversions of a reinterpret_cast is not allowed in a constant expression<br>
4> static constexpr size_t _Memcpy_move_offset = offsetof(_Mydata_t, _Bx);<br>
4> ^<br>
4>C:/Program Files (x86)/Windows Kits/10/Include/10.0.14393.0/<wbr>ucrt\stddef.h:42:32: note: expanded from macro 'offsetof'<br>
4> #define offsetof(s,m) ((size_t)&reinterpret_cast<<wbr>char const volatile&>((((s*)0)->m)))<br>
4><br>
<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\xstring(1906,26): error G3F63BFAE: constexpr variable '_Memcpy_move_size' must be initialized by a constant expression<br>
4> static constexpr size_t _Memcpy_move_size = sizeof(_Mydata_t) - _Memcpy_move_offset;<br>
4> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<wbr>~~~~~~~~~<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\xstring:1906:66: note: initializer of '_Memcpy_move_offset' is not a constant expression<br>
4> static constexpr size_t _Memcpy_move_size = sizeof(_Mydata_t) - _Memcpy_move_offset;<br>
4> ^<br>
4>C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/<wbr>Tools/MSVC/14.10.25017/<wbr>include\xstring:1905:26: note: declared here<br>
4> static constexpr size_t _Memcpy_move_offset = offsetof(_Mydata_t, _Bx);<br>
<br>
Have the python wrapping been tested for compilation with latest standards (constexpr is C++11 if I remember well) ?<br>
<br>
Tim<br>
______________________________<wbr>_________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/community</a><br>
</blockquote></div><br></div>