<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>As usual, when I have an unusual problem it is because I have done something dumb. In an earlier attempt to fix this, I mistakenly added an ADD_DEFINITION clause containing –std=c++11 to the main CMakeLists.txt file. This flag was then being inserted in places it wasn’t supposed to be, such as C_FLAGS. Because I was only deleting build directory, this problem remained. It appears to build fine now.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for all the help!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Jean-Christophe Fillion-Robin [mailto:jchris.fillionr@kitware.com] <br><b>Sent:</b> Tuesday, April 15, 2014 5:41 PM<br><b>To:</b> Becksfort, Jared<br><b>Cc:</b> Bradley Lowekamp; insight-users@itk.org; Johnson, Hans J<br><b>Subject:</b> Re: [ITK-users] C++11?<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hi,<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>The environment variables that should be set are:<o:p></o:p></p></div><div><p class=MsoNormal>CC <o:p></o:p></p></div><div><p class=MsoNormal>CXX <br>CFLAGS<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>CXXFLAGS<o:p></o:p></p></div><div><p class=MsoNormal>For reference, see the following links:<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><br><a href="https://github.com/Kitware/CMake/blob/593b69c9dc9e692b198f1ddbf9251130e61a4679/Modules/CMakeDetermineCCompiler.cmake#L51">https://github.com/Kitware/CMake/blob/593b69c9dc9e692b198f1ddbf9251130e61a4679/Modules/CMakeDetermineCCompiler.cmake#L51</a><br><a href="https://github.com/Kitware/CMake/blob/593b69c9dc9e692b198f1ddbf9251130e61a4679/Modules/CMakeDetermineCXXCompiler.cmake#L50">https://github.com/Kitware/CMake/blob/593b69c9dc9e692b198f1ddbf9251130e61a4679/Modules/CMakeDetermineCXXCompiler.cmake#L50</a><br><a href="https://github.com/Kitware/CMake/blob/8472ef243ffc9988ea8fb83cbc7acdf3f0daa239/Modules/CMakeCInformation.cmake#L105">https://github.com/Kitware/CMake/blob/8472ef243ffc9988ea8fb83cbc7acdf3f0daa239/Modules/CMakeCInformation.cmake#L105</a><br><a href="https://github.com/Kitware/CMake/blob/8472ef243ffc9988ea8fb83cbc7acdf3f0daa239/Modules/CMakeCXXInformation.cmake#L20">https://github.com/Kitware/CMake/blob/8472ef243ffc9988ea8fb83cbc7acdf3f0daa239/Modules/CMakeCXXInformation.cmake#L20</a><o:p></o:p></p></div></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Apr 15, 2014 at 6:26 PM, Becksfort, Jared <<a href="mailto:Jared.Becksfort@stjude.org" target="_blank">Jared.Becksfort@stjude.org</a>> wrote:<o:p></o:p></p><p class=MsoNormal>From earlier email, I think there is in fact a problem with the flags for<br>the C compiler:<br><br>I have attached the version generated by ccmake for this file:<br><br>Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/flags.make<br><br>Note it has a -std=c++11 in the C flags. Any thoughts on why it's there<br>and how to remove it?<br><br>I don't have C_FLAGS set anywhere, and it doesn't appear in the ccmake<br>screen (although neither does my CXX_FLAGS and it shows up, so who knows).<br><br>Thanks again,<br>Jared<o:p></o:p></p><div><div><p class=MsoNormal><br>On 4/15/14 5:03 PM, "Becksfort, Jared" <<a href="mailto:Jared.Becksfort@STJUDE.ORG">Jared.Becksfort@STJUDE.ORG</a>> wrote:<br><br>>Thank you Brad and Hans for replying. Unfortunately I am still having<br>>problems. Two things I think are odd are that<br>><br>>- ccmake finds my CXX environment variable but not my CXX_FLAGS, according<br>>to the curses window.<br>>- It seems like the error I am getting is that it is trying to add<br>>-std=c++11 to the compilation of a C file.<br>><br>>I remove the bin/* directory between each attempt, so I doubt it is a<br>>caching problem.<br>><br>>L130723:bin jbecksfo$ echo $CXX<br>>/usr/bin/clang++ ### this value shows up in the ccmake configuration<br>>window<br>>L130723:bin jbecksfo$ echo $CXX_FLAGS<br>>-std=c++11 -stdlib=libc++ ### this value does not show up in the ccmake<br>>configuration window<br>><br>><br>>I then run make (which I *think* I am supposed to do) and the error I get<br>>happens whether I use cmake with arguments or ccmake:<br>><br>>Scanning dependencies of target itksys<br>>[ 21%] Building C object<br>>Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/ProcessUNIX.c.o<br>>error: invalid argument '-std=c++11' not allowed with 'C/ObjC'<br>>make[2]: ***<br>>[Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/ProcessUNIX.c.o]<br>>Error 1<br>>make[1]: ***<br>>[Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/all] Error 2<br>>make: *** [all] Error 2<br>><br>>I can attach files if that would help. I appreciate very much whatever<br>>information you can provide.<br>><br>>Thanks,<br>>Jared<br>><br>><br>><br>><br>><br>>On 4/14/14 10:31 AM, "Bradley Lowekamp" <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>><br>>>Hello,<br>>><br>>>Just to further elaborate, in the cmake configuration you need to add<br>>>"-std=c++11", to CMAKE_CXX_FLAGS on the command line before the first<br>>>configuration something like:<br>>><br>>>cmake -DCMAKE_CXX_FLAGS="-std=c++11" /your/source/ITK<br>>><br>>>Alternatively you can set the CXX_FLAGS environment variable similarly.<br>>>Either way this should be done a new build directory with a clean<br>>>configuration, not a reconfiguration.<br>>><br>>>Additionally, project that use this C++11 build of ITK should use the<br>>>same flag.<br>>><br>>>Brad<br>>><br>>>On Apr 13, 2014, at 11:33 AM, Johnson, Hans J <<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>><br>>>wrote:<br>>><br>>>> Jared,<br>>>><br>>>> ADD_DEFINTIONS is not intended for compiler flags. You need to<br>>>>configure<br>>>> the build initializing with the C++ flags<br>>>><br>>>> CXX=Œ/usr/bin/clang¹ CXX_FLAGS=³-std=c++11² ccmake ../ITK<br>>>><br>>>> Hans<br>>>><br>>>><br>>>><br>>>> On 4/12/14, 10:41 PM, "Becksfort, Jared" <<a href="mailto:Jared.Becksfort@STJUDE.ORG">Jared.Becksfort@STJUDE.ORG</a>><br>>>> wrote:<br>>>><br>>>>> Hello,<br>>>>><br>>>>> I was hoping to build the 4.5.2 with C++11. Are there instructions<br>>>>>for<br>>>>> doing so? I tried adding<br>>>>><br>>>>> ADD_DEFINITIONS(<br>>>>> -std=c++11<br>>>>> )<br>>>>><br>>>>> to the CMakeLists.txt file, which felt like a hack and didn't work:<br>>>>><br>>>>> Scanning dependencies of target itksys<br>>>>> [ 21%] Building C object<br>>>>><br>>>>>Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/ProcessUNIX.c.<br>>>>>o<br>>>>> error: invalid argument '-std=c++11' not allowed with 'C/ObjC'<br>>>>> make[2]: ***<br>>>>><br>>>>>[Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/ProcessUNIX.c<br>>>>>.<o:p></o:p></p></div></div><div><div><p class=MsoNormal style='margin-bottom:12.0pt'>>>>>o]<br>>>>> Error 1<br>>>>> make[1]: ***<br>>>>> [Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/itksys.dir/all] Error 2<br>>>>> make: *** [all] Error 2<br>>>>><br>>>>> Thanks,<br>>>>> Jared<br>>>>><br>>>>> Email Disclaimer: <a href="http://www.stjude.org/emaildisclaimer" target="_blank">www.stjude.org/emaildisclaimer</a><br>>>>> Consultation Disclaimer: <a href="http://www.stjude.org/consultationdisclaimer" target="_blank">www.stjude.org/consultationdisclaimer</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>>>><br>>>><br>>>><br>>>> ________________________________<br>>>> Notice: This UI Health Care e-mail (including attachments) is covered<br>>>>by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is<br>>>>confidential and may be legally privileged. If you are not the intended<br>>>>recipient, you are hereby notified that any retention, dissemination,<br>>>>distribution, or copying of this communication is strictly prohibited.<br>>>>Please reply to the sender that you have received the message in error,<br>>>>then delete it. Thank you.<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>>><br>>><br>><o:p></o:p></p></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><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><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><br>-- <br>+1 919 869 8849<o:p></o:p></p></div></div></body></html>