<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jun 14, 2014, at 11:59 AM, Jonathan Roelofs <<a href="mailto:jonathan@codesourcery.com">jonathan@codesourcery.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><br>On 6/13/14, 5:06 PM, Joseph Morgan wrote:<br><blockquote type="cite"><br>On Jun 12, 2014, at 4:37 PM, Jonathan Roelofs <<a href="mailto:jonathan@codesourcery.com">jonathan@codesourcery.com</a><br><<a href="mailto:jonathan@codesourcery.com">mailto:jonathan@codesourcery.com</a>>> wrote:<br><br><blockquote type="cite"><br><br>On 6/12/14, 3:07 PM, Joseph wrote:<br><blockquote type="cite">Hi Dan,<br><br><br>So now that the includes are being found building the tutorial results in 74<br>warnings and 20 errors. Heres a couple examples:<br><br>In file included from /usr/local/include/llvm/IR/DerivedTypes.h:21:<br>In file included from /usr/local/include/llvm/IR/Type.h:19:<br>In file included from /usr/local/include/llvm/ADT/APFloat.h:20:<br>In file included from /usr/local/include/llvm/ADT/APInt.h:19:<br>In file included from /usr/local/include/llvm/ADT/ArrayRef.h:14:<br>/usr/local/include/llvm/ADT/SmallVector.h:232:20: warning: rvalue references<br>are a C++11 extension [-Wc++11-extensions]<br> void push_back(T &&Elt) {<br>                  ^<br>/usr/local/include/llvm/ADT/SmallVector.h:476:33: warning: rvalue references<br>are a C++11 extension [-Wc++11-extensions]<br> iterator insert(iterator I, T &&Elt) {<br><br></blockquote>You need to build Clang/LLVM with a {CXX, CXXFLAGS} pair (read: a c++ compiler<br>for your host) that supports C++11. That can either be one whose default is<br>c++11, or one that doesn't but lets you put '--std=c++11' in the CXXFLAGS.<br><br><a href="http://llvm.org/docs/GettingStarted.html">http://llvm.org/docs/GettingStarted.html</a> suggests GCC >= 4.7.0 for this.<br></blockquote><br>Hello again,<br><br>Running gcc —version gets me the following results:<br><br>Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr<br>--with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1<br>Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)<br><br>So it looks like I do not have proper GCC installed, I figured that Xcode would<br>have gcc included.<br></blockquote>These days, Xcode ships with Clang (which is a drop-in replacement for GCC, based on LLVM). This should be fine for building TOT Clang/LLVM from source, as long as it is new enough (and I *think* it is).<br><blockquote type="cite"><br>I can see that I am in over my head because I do not know what CXX, CXXFLAGS are<br>and where do you apply them? In make?<br></blockquote>These are just canonical names for set of flags you pass to a build system (see:<span class="Apple-converted-space"> </span><a href="http://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#Implicit-Variables">http://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#Implicit-Variables</a><span class="Apple-converted-space"> </span>for more examples).<br><br>The idea is that you would set the ones that you need when configuring (where the default doesn't quite make sense for your platform)... so I think in your case, you'd want something like this:<br><br>../llvm/configure CXX=`which clang++` CXXFLAGS="--std=c++11”<br></div></blockquote><div><br></div><div><br></div><div>Thanks Jon for your advice. I am still getting the same errors. When I check the cxxflags here’s the output:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Josephs-iMac:~ josephmorgan$ /Users/josephmorgan/build/Debug+Asserts/bin/llvm-config —cxxflags</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">-I/Users/josephmorgan/llvm/include -I/Users/josephmorgan/build/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><div style="margin: 0px;">Josephs-iMac:~ josephmorgan$ /Users/josephmorgan/build/Debug+Asserts/bin/llvm-config --cppflags</div><div style="margin: 0px;">-I/Users/josephmorgan/llvm/include -I/Users/josephmorgan/build/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS</div></div></div><div><br></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Josephs-iMac:~ josephmorgan$  /Users/josephmorgan/build/Debug+Asserts/bin/llvm-config --cflags</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">-I/Users/josephmorgan/llvm/include -I/Users/josephmorgan/build/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -fno-common</div></div><div><br></div><div>Does that look correct in your opinion?</div><div><br></div><div>Thanks again!</div><div>Joseph</div><br><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>Cheers,<br><br>Jon<br><blockquote type="cite"><br>In other words what does " put '--std=c++11' in the CXXFLAGS” mean? Do you have<br>an example of what it would look like? or what should I read in order to learn<br>this? I’m happy to read up but I don’t know where to start reading (besides the<br>getting started page on llvm)   :)<br><br>Thank you for your suggestions!<br>Joseph Morgan<br><br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Jon Roelofs<br><a href="mailto:jonathan@codesourcery.com">jonathan@codesourcery.com</a><br>CodeSourcery / Mentor Embedded</div></blockquote></div><br></body></html>