[cfe-dev] Building AST at runtime

João Matos ripzonetriton at gmail.com
Fri Jul 12 19:56:52 PDT 2013


On Sat, Jul 13, 2013 at 12:09 AM, Daniel Albuschat <d.albuschat at gmail.com>
wrote:
>
> I get the following error mesage from the code:
> > error: unknown target triple '', please use -triple or -arch
>
> I thought I provided the required triple in the call to
clang::TargetInfo::CreateTargetInfo, passing targetOptions, which "Triple"
member has been set to "i386-pc-win32" (which was only a guess, since I did
not find a reference for the string syntax of a target triple).


Try using llvm::sys::getDefaultTargetTriple().

Also you could try to look into this code to see how I initialize Clang
manually (I don't know if it's the "correct" way to do it, but it's been
working fine):
https://github.com/mono/CppSharp/blob/master/src/Parser/Parser.cpp

--
João Matos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130713/b4aec239/attachment.html>


More information about the cfe-dev mailing list