<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=iso-8859-9"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1705861902;
mso-list-type:hybrid;
mso-list-template-ids:-1580817308 939715506 69140483 69140485 69140481 69140483 69140485 69140481 69140483 69140485;}
@list l0:level1
{mso-level-start-at:25;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:20.25pt;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:56.25pt;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:92.25pt;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:128.25pt;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:164.25pt;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:200.25pt;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:236.25pt;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:272.25pt;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:308.25pt;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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=TR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Hello again João,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>I’m using Visual Studio 2010 and I have managed to clear some of the produced errors. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>But right now I’m struggling with three errors;<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:Symbol;color:#1F497D;mso-fareast-language:EN-US'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include\new(49,15) : error: function declared 'cdecl' here was previously declared without calling convention [Semantic Issue]<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:Symbol;color:#1F497D;mso-fareast-language:EN-US'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include\xstring(2067,21) : error: use of undeclared identifier 'char16_t' [Semantic Issue]<o:p></o:p></span></p><p class=MsoListParagraph style='margin-left:20.25pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:Symbol;color:#1F497D;mso-fareast-language:EN-US'><span style='mso-list:Ignore'>·<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include\xlocale(1235,29) : error: use of undeclared identifier 'char32_t' [Semantic Issue]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In addition to these, after changing some parameters diagnostics started acting like crazy. I didn’t do anything about the diagnostics. Here is some diagnostic outputs;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>In included file:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>error: function declared 'cdecl' here was previously declared without calling convention<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>note: previous declaration is here<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>error: function declared 'cdecl' here was previously declared without calling convention<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>note: previous declaration is here<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>error: function declared 'cdecl' here was previously declared without calling convention<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>note: previous declaration is here<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>error: function declared 'cdecl' here was previously declared without calling convention<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>note: previous declaration is here<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>I think I’m getting closer :D<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Thank you and have a nice day,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Orçun<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Here is the code so far;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;color:blue;mso-fareast-language:EN-US'>int</span><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>main_compiler_instance</span>(<span style='color:blue'>int</span> <span style='color:#010001'>argc</span>, <span style='color:blue'>const</span> <span style='color:blue'>char</span>** <span style='color:#010001'>argv</span>)<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'>{<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Default Windows Platform Arguments</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// These arguments has been taken from cmake -v</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>const</span> <span style='color:blue'>char</span>* <span style='color:#010001'>Arguments</span>[] =<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-cc1"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-I"</span>, <span style='color:#A31515'>"."</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-I"</span>, <span style='color:#A31515'>".."</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-I"</span>, <span style='color:#A31515'>"../ZEFoundation"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-v"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fmath-errno"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-ferror-limit"</span>, <span style='color:#A31515'>"19"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fmessage-length"</span>, <span style='color:#A31515'>"150"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fms-extensions"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fms-compatibility"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fmsc-version=1300"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fdelayed-template-parsing"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fno-rtti"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fcolor-diagnostics"</span>,<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-x"</span>, <span style='color:#A31515'>"c++"</span>, <span style='color:green'>// NOT WORKING !!! It is working in clang.exe command line but not here. I don't know why...</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-std=c++0x"</span>, <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#A31515'>"-fsyntax-only"</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> };<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>size_t</span> <span style='color:#010001'>ArgumentCount</span> = <span style='color:blue'>sizeof</span>(<span style='color:#010001'>Arguments</span>) / <span style='color:blue'>sizeof</span>(<span style='color:blue'>const</span> <span style='color:blue'>char</span>*);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>CompilerInstance</span> <span style='color:#010001'>Compiler</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>createDiagnostics</span>(0, <span style='color:#010001'>NULL</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Target Options</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>TargetOptions</span> <span style='color:#010001'>TO</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>TO</span>.<span style='color:#010001'>Triple</span> = <span style='color:#010001'>llvm</span>::<span style='color:#010001'>sys</span>::<span style='color:#010001'>getDefaultTargetTriple</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>TargetInfo</span>* <span style='color:#010001'>TI</span> = <span style='color:#010001'>TargetInfo</span>::<span style='color:#010001'>CreateTargetInfo</span>(<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getDiagnostics</span>(), <span style='color:#010001'>TO</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>TI</span>-><span style='color:#010001'>setCXXABI</span>(<span style='color:#010001'>TargetCXXABI</span>::<span style='color:#010001'>CXXABI_Microsoft</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>setTarget</span>(<span style='color:#010001'>TI</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>CompilerInvocation</span> <span style='color:#010001'>Invocation</span>;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>bool</span> <span style='color:#010001'>Result</span> = <span style='color:#010001'>CompilerInvocation</span>::<span style='color:#010001'>CreateFromArgs</span>(<span style='color:#010001'>Invocation</span>, <span style='color:#010001'>Arguments</span>, <span style='color:#010001'>Arguments</span> + <span style='color:#010001'>ArgumentCount</span>, <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getDiagnostics</span>());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// -x c++ not working so; (I’m not sure whether it Works or not)</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>CompilerInvocation</span>::<span style='color:#010001'>setLangDefaults</span>(*<span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getLangOpts</span>(), <span style='color:#010001'>InputKind</span>::<span style='color:#010001'>IK_CXX</span>, <span style='color:#010001'>LangStandard</span>::<span style='color:#010001'>Kind</span>::<span style='color:#010001'>lang_cxx11</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Resource Directory</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>if</span> (<span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>UseBuiltinIncludes</span> && <span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>ResourceDir</span>.<span style='color:#010001'>empty</span>())<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> {<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// I'm going to distribute clang runtime include directory in tools binary directory. </span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Like if the path of tools binary is c:\tool\codegen.exe then include files will be in c:\tool\include</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>llvm</span>::<span style='color:#010001'>sys</span>::<span style='color:#010001'>Path</span> <span style='color:#010001'>BinaryDir</span> = <span style='color:#010001'>llvm</span>::<span style='color:#010001'>sys</span>::<span style='color:#010001'>Path</span>::<span style='color:#010001'>GetMainExecutable</span>(<span style='color:#010001'>argv</span>[0], <span style='color:#010001'>main_compiler_instance</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>BinaryDir</span>.<span style='color:#010001'>eraseComponent</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>ResourceDir</span> = <span style='color:#010001'>BinaryDir</span>.<span style='color:#010001'>str</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> }<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Include Path</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Thanks for the patch João Matos.</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>std</span>::<span style='color:#010001'>vector</span><<span style='color:#010001'>std</span>::<span style='color:#010001'>string</span>> <span style='color:#010001'>SystemDirs</span> = <span style='color:#010001'>clang</span>::<span style='color:#010001'>driver</span>::<span style='color:#010001'>GetWindowsSystemIncludeDirs</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>for</span>(<span style='color:#010001'>size_t</span> <span style='color:#010001'>i</span> = 0; <span style='color:#010001'>i</span> < <span style='color:#010001'>SystemDirs</span>.<span style='color:#010001'>size</span>(); ++<span style='color:#010001'>i</span>) <o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>AddPath</span>(<span style='color:#010001'>SystemDirs</span>[<span style='color:#010001'>i</span>], <span style='color:#010001'>frontend</span>::<span style='color:#010001'>System</span>, <span style='color:blue'>false</span>, <span style='color:blue'>false</span>, <span style='color:blue'>true</span>, <span style='color:blue'>true</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>AddPath</span>(<span style='color:#010001'>Invocation</span>.<span style='color:#010001'>getHeaderSearchOpts</span>().<span style='color:#010001'>ResourceDir</span> + <span style='color:#A31515'>"/include"</span>, <span style='color:#010001'>clang</span>::<span style='color:#010001'>frontend</span>::<span style='color:#010001'>System</span>, <span style='color:blue'>false</span>, <span style='color:blue'>false</span>, <span style='color:blue'>true</span>, <span style='color:blue'>true</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>// Compiler Definitions</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:green'>//Invocation.getPreprocessorOpts().addMacroDef("_WCHAR_T_DEFINED");</span><o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>setInvocation</span>(&<span style='color:#010001'>Invocation</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>createFileManager</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>createSourceManager</span>(<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getFileManager</span>());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>createPreprocessor</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>setASTConsumer</span>(<span style='color:blue'>new</span> <span style='color:#010001'>ZECodeGeneratorASTConsumer</span>());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>createASTContext</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>const</span> <span style='color:#010001'>FileEntry</span> *<span style='color:#010001'>pFile</span> = <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getFileManager</span>().<span style='color:#010001'>getFile</span>(<span style='color:#010001'>argv</span>[1]);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getSourceManager</span>().<span style='color:#010001'>createMainFileID</span>(<span style='color:#010001'>pFile</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getDiagnosticClient</span>().<span style='color:#010001'>BeginSourceFile</span>(<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getLangOpts</span>(), &<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getPreprocessor</span>());<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>ParseAST</span>(<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getPreprocessor</span>(), &<span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getASTConsumer</span>(), <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getASTContext</span>(), <span style='color:blue'>false</span>, <span style='color:#010001'>clang</span>::<span style='color:#010001'>TU_Complete</span>, <span style='color:#010001'>NULL</span>, <span style='color:blue'>true</span>);<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:#010001'>Compiler</span>.<span style='color:#010001'>getDiagnosticClient</span>().<span style='color:#010001'>EndSourceFile</span>();<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'> <span style='color:blue'>return</span> 1;<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span lang=EN-US style='font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-US'>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> cfe-dev-bounces@cs.uiuc.edu [mailto:cfe-dev-bounces@cs.uiuc.edu] <b>On Behalf Of </b>Y. Orçun Gökbulut<br><b>Sent:</b> Tuesday, September 04, 2012 1:32 PM<br><b>To:</b> 'João Matos'<br><b>Cc:</b> cfe-dev@cs.uiuc.edu<br><b>Subject:</b> Re: [cfe-dev] Tool programming. Where can I get default platform configuration ?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Hi João,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Thank you so much for your reply and patch.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>I have applied your patch and modified my driver according to your code. It really automated things like getting system paths but I still got errors in system headers (Visual Studio’s c library). <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>I think problem is clang can not parse visual studio c library headers becouse it could not found Microsoft specific type_info struct or __CHAR_BIT__.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>I just can figure out the difference between a clang driver with my own code. They are doing the same thing. They are using compiler invocation so I do it too. I’m really stuck.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Thank you,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'>Orçun<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> João Matos [<a href="mailto:ripzonetriton@gmail.com">mailto:ripzonetriton@gmail.com</a>] <br><b>Sent:</b> Saturday, September 01, 2012 4:10 PM<br><b>To:</b> Y. Orçun Gökbulut<br><b>Cc:</b> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><b>Subject:</b> Re: [cfe-dev] Tool programming. Where can I get default platform configuration ?<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Hi. I'm also using Clang for a similiar tool (generate reflection data for C++), check out the attached source file 'ParserInit.cpp' to see how I initialize it.<o:p></o:p></p><div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>You're also gonna need the attached patch applied to Clang, it exposes the Windows SDK headers locations.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>-- <o:p></o:p></p></div><p class=MsoNormal>João Matos<o:p></o:p></p></div></div></body></html>