<div dir="rtl"><div dir="ltr">Shouldn't -std=c++11 be there also?</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2014-12-17 5:15 GMT+02:00 Rodney M. Bates <span dir="ltr"><<a href="mailto:rodney_bates@lcwb.coop" target="_blank">rodney_bates@lcwb.coop</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is partly an llvm question, and maybe partly C++.<br>
<br>
I am trying to make calls on code in the llvm infrastructure.(3.4.2)  I appear<br>
to be missing some include files, but don't know how to track them down.  I get<br>
compile errors on existing llvm header files, like the following two examples:<br>
------------------------------<u></u>------------------------------<u></u>--------------------<br>
<br>
In file included from LLVMDIBuilder.cpp:16:<br>
In file included from /usr/local/include/llvm/<u></u>Support/CBindingWrapping.h:17:<br>
In file included from /usr/local/include/llvm/<u></u>Support/Casting.h:18:<br>
In file included from /usr/local/include/llvm/<u></u>Support/type_traits.h:22:<br>
In file included from /usr/lib/gcc/x86_64-linux-gnu/<u></u>4.8/../../../../include/c++/4.<u></u>8/utility:70:<br>
In file included from /usr/lib/gcc/x86_64-linux-gnu/<u></u>4.8/../../../../include/c++/4.<u></u>8/bits/stl_pair.h:59:<br>
/usr/lib/gcc/x86_64-linux-gnu/<u></u>4.8/../../../../include/c++/4.<u></u>8/bits/move.h:185:5: error: conflicting types for 'swap'<br>
    swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])<br>
    ^<br>
/usr/lib/gcc/x86_64-linux-gnu/<u></u>4.8/../../../../include/c++/4.<u></u>8/bits/move.h:166:5: note: previous definition is here<br>
    swap(_Tp& __a, _Tp& __b)<br>
<br>
------------------------------<u></u>------------------------------<u></u>--------------------<br>
In file included from LLVMDIBuilder.cpp:16:<br>
In file included from /usr/local/include/llvm/<u></u>Support/CBindingWrapping.h:17:<br>
In file included from /usr/local/include/llvm/<u></u>Support/Casting.h:18:<br>
/usr/local/include/llvm/<u></u>Support/type_traits.h:48:33: error: functions that differ only in their return type cannot be overloaded<br>
    template<typename T> double is_class_helper(...);<br>
                                ^<br>
/usr/local/include/llvm/<u></u>Support/type_traits.h:47:31: note: previous declaration is here<br>
    template<typename T> char is_class_helper(void(T::*)());<br>
                              ^<br>
------------------------------<u></u>------------------------------<u></u>--------------------<br>
<br>
Obviously, these files compile when included by the normal llvm build<br>
process.  I have gotten many previous similar errors to go away by rote copying<br>
in of all the #include lines in the full code listing in the new Kaleidoscope<br>
Chapter 8 example and all those in core.cpp, but many more remain.<br>
<br>
I would have expected missing declarations from missing include files to<br>
give error messages like "undeclared identifier", but the effect seems to<br>
be to make types that look different be the same, and vice versa (but<br>
apparently not different enough to be legal overloads?).<br>
<br>
My command line is:<br>
<br>
clang++ -g LLVMDIBuilder.cpp `llvm-config --cxxflags --libs all`<br>
<br>
$lvm-config --cxxflags --libs all<br>
-I/usr/local/include  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual<br>
-lLLVMInstrumentation -lLLVMIRReader -lLLVMAsmParser -lLLVMDebugInfo -lLLVMOption -lLLVMLTO -lLLVMLinker -lLLVMipo -lLLVMVectorize -lLLVMBitWriter -lLLVMBitReader -lLLVMTableGen -lLLVMR600CodeGen -lLLVMR600Desc -lLLVMR600Info -lLLVMR600AsmPrinter -lLLVMSystemZDisassembler -lLLVMSystemZCodeGen -lLLVMSystemZAsmParser -lLLVMSystemZDesc -lLLVMSystemZInfo -lLLVMSystemZAsmPrinter -lLLVMHexagonCodeGen -lLLVMHexagonAsmPrinter -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMXCoreDisassembler -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMXCoreAsmPrinter -lLLVMMipsDisassembler -lLLVMMipsCodeGen -lLLVMMipsAsmParser -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMAArch64Disassem!<br>
bler -lLLV<br>
MAArch64CodeGen -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info -lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMPowerPCCodeGen -lLLVMPowerPCAsmParser -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInterpreter -lLLVMMCJIT -lLLVMJIT -lLLVMCodeGen -lLLVMObjCARCOpts -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport<br>
<br>
How do I figure out what to include to fix these?<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
<br>
-- <br>
Rodney Bates<br>
<a href="mailto:rodney.m.bates@acm.org" target="_blank">rodney.m.bates@acm.org</a><br>
______________________________<u></u>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/llvmdev</a><br>
</font></span></blockquote></div></div>