I am trying to run a C++ program which has following header.
#include <clang-c/Index.h>
And its main function look like this.
int main(int argc, char **argv) {
if (argc < 2) {
std::cerr<< "Missing argument: path to source\n";
return -1;
}
CXIndex index = clang_createIndex(0, 1);
CXTranslationUnit tu;
.....remaining program.
I have downloaded and installed LLVM 10.0 Windows(64bit) from following link.
LLVM download link windows
Also i have downloaded and installed CMake 3.18 for Windows(64bit) from following link.
CMake download link windows
Also i have installed Visual Studio Community 15 2017.
Clang++ command works for simple C++ programs. But when i try to run my program with this header.
clang++ node.cpp
I get an error.
fatal error: 'clang-c/Index.h' file not found
I have checked that this header file is located in C:\Program Files\LLVM\include\clang-c. But when i run i get the error.
I have checked my environment variables and saw these two paths are there.
C:\Program Files\CMake\bin
C:\Program Files\LLVM\bin
I have searched a lot but did not found any solution on google for windows. Please tell me what i am doing wrong. Or if it requires a different command to run this program.