<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;"><div><br></div><div><br></div><div><br></div><div><blockquote type="cite">On Fri, Jun 13, 2014 at 06:06:24PM -0500, Joseph Morgan wrote:<br><blockquote type="cite">In other words what does " put '--std=c++11' in the CXXFLAGS” mean?<br></blockquote><br>Just for reference, the option is -std=c++11, single hyphen.<br><br>Joerg</blockquote></div><div>^^ As for the build of LLVM/Clang, I rebuilt with single hyphen as follows :</div><div><div style="margin: 0px;">/Users/josephmorgan/llvm/configure --enable-targets=x86,x86_64 CXX=`which clang++` CXXFLAGS="-std=c++11"</div></div><div><br></div><div><br></div><div><br></div><div>And now for the tutorial, somewhere along the line I have used two versions of the following when compiling the tutorial file:</div><div><br></div><div><div>clang++ -g -O3 toy.cpp `llvm-config --<b>cxxflags</b> --ldflags --libs core` -o toy <—this is from <a href="http://llvm.org/docs/tutorial/LangImpl3.html">http://llvm.org/docs/tutorial/LangImpl3.html</a> see results below:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">Undefined symbols for architecture x86_64:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  "_del_curterm", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      terminalHasColors(int) in libLLVMSupport.a(Process.o)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  "_set_curterm", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      terminalHasColors(int) in libLLVMSupport.a(Process.o)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  "_setupterm", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      terminalHasColors(int) in libLLVMSupport.a(Process.o)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  "_tigetnum", referenced from:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">      terminalHasColors(int) in libLLVMSupport.a(Process.o)</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">ld: symbol(s) not found for architecture x86_64</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">clang: error: linker command failed with exit code 1 (use -v to see invocation)</div></div><div><br></div><div><br></div><div><br></div><div>clang++ -g -O3 toy.cpp `llvm-config --<b>cppflags</b> --ldflags --libs core` -o toy <—not sure where in this thread I picked this up but see results below:</div></div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from toy.cpp:2:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from /usr/local/include/llvm/IR/DerivedTypes.h:21:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from /usr/local/include/llvm/IR/Type.h:19:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from /usr/local/include/llvm/ADT/APFloat.h:20:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from /usr/local/include/llvm/ADT/APInt.h:19:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">In file included from /usr/local/include/llvm/ADT/ArrayRef.h:14:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>/usr/local/include/llvm/ADT/SmallVector.h:232:20: </b><span style="color: #d53bd3"><b>warning: </b></span><b>rvalue references are</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><b>      a C++11 extension [-Wc++11-extensions]</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">  void push_back(T &&Elt) {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;">…….Several other errors/warnings</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;"><br></div><div style="margin: 0px;"><div style="font-size: 11px; font-family: Menlo; margin: 0px;"><span style="color: #c33720"><b>fatal error: </b></span><b>too many errors emitted, stopping now [-ferror-limit=]</b></div><div style="font-size: 11px; font-family: Menlo; margin: 0px;">72 warnings and 20 errors generated.</div><div style="font-size: 11px; font-family: Menlo; margin: 0px;"><br></div><div style="font-size: 11px; font-family: Menlo; margin: 0px;"><br></div><div style="font-size: 11px; font-family: Menlo; margin: 0px;"><br></div><div style="font-size: 11px; font-family: Menlo; margin: 0px;"><br></div><div style="margin: 0px;"><font face="Arial" size="2">I appreciate your help!</font></div><div style="margin: 0px;"><font face="Arial" size="2"><br></font></div><div style="margin: 0px;"><font face="Arial" size="2">Joseph Morgan</font></div></div></div><div><br></div><br><div><div>On Jun 16, 2014, at 2:35 PM, 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/16/14, 1:14 PM, Dan Liew wrote:<br><blockquote type="cite">Hi Joseph,<br><br><blockquote type="cite">In other words what does " put '--std=c++11' in the CXXFLAGS” mean? Do you<br>have an example of what it would look like? or what should I read in order<br>to learn this? I’m happy to read up but I don’t know where to start reading<br>(besides the getting started page on llvm)   :)<br></blockquote><br>You're still trying to build the tutorial right? I assume you<br>successfully built LLVM already. So if you're building the tutorial<br>you probably just need this.<br><br>clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --libs core` -o toy<br><br>I see your `llvm-config --cxxflags`` output already has --std=c++11<br>already in it (your --cppflags does not. I'm not sure why).<br></blockquote>Dan, the preprocessor shouldn't need to know about '--std=c++11' right?<br><br>Maybe the confusion here is over which one of '--cppflags' vs '--cxxflags' to use where (the former is for the preprocessor, the latter is for the c++ compiler).<br><br><br>Also, looking at an example from earlier in the thread:<br><br>```<br>clang++ -g -O3 toy.cpp<br>`/Users/josephmorgan/build/Release+Assert/bin/llvm-config --cppflags<br>--ldflags --libs core` -o toy<br>```<br><br>This suspiciously looks like you're using the just-built llvm-config to give parameters to the system installed clang++. IOW, this could lead you into trouble if `which clang++` doesn't point you to the one in /Users/josephmorgan/build/Release+Assert/bin/ (this really depends on what's on your PATH).<br><br><blockquote type="cite"><br>I think Jonanthan may have confused you because his suggestion of<br><br>../llvm/configure CXX=`which clang++` CXXFLAGS="--std=c++11"<br><br>is for configuring and building LLVM/Clang which you've already done.<br></blockquote>Yes, this suggestion is for configuring/building clang... sorry if that added to the confusion.<br><blockquote type="cite">So you shouldn't need to do that again.<br><br>Thanks,<br><br></blockquote><br>Cheers,<br>Jon<br><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>