chandan kharbanda
chandan kharbanda

Reputation: 199

How to include llvm/IR/Module.h in c++ on Mac / OS X?

I'm trying to compile a simple file which requires llvm headers.

#include <llvm/IR/Module.h>
int main() {
    return 0;
}

I am on mac os. I use following command to compile the code.

g++ s.cpp `llvm-config --cxxflags --system-libs --ldflags --libs core`

Do I need to build llvm from source code ? Is there anything missing ?

Upvotes: 2

Views: 1236

Answers (1)

Joky
Joky

Reputation: 1628

You need to install LLVM, it is not provided by the system, and Xcode does not ship one that you can actually use (other than clang for compiling C/C++/ObjC, and swift-c for Swift). You can either grab a binary release from llvm.org, or use brew, or build it from source!

Upvotes: 2

Related Questions