I'm trying to learn about LLVM API working on Windows, I have installed LLVM 3.6 (llvm tools, clang, etc) successfully, have Mingw and I'm trying to compile this example.
both commmands work on my environment:
clang -c -emit-llvm test.c -o test.ll
llc -march=cpp test.ll -o test.cpp
but when trying to compile this new test.cpp file I got:
C:\Users\Alex\Desktop>clang test.cpp `llvm-config --cxxflags --ldflags --libs core` -o test
clang.exe: error: unsupported option '--cxxflags'
clang.exe: error: unsupported option '--ldflags'
clang.exe: error: unsupported option '--libs'
clang.exe: error: no such file or directory: '`llvm-config'
clang.exe: error: no such file or directory: 'core`'
Any idea? I'm very newbie using LLVM.
It looks like you are using Windows'
cmd.exeas your shell, (i.e. command interpreter), but you are attempting to invoke theclangcommand using a Unix Bourne shell syntax, (the back-tick quotedllvm-configcommand substitution), whichcmd.exesimply doesn't understand.If you want to use this command syntax, then you'd better find a more capable shell than
cmd.exe; perhaps try MSYS or cygwin.