When I attempt to follow any tutorial for llvm and add the llvm-config --cxxflags --ldflags --libs all
line to my GXX_FLAGS, g++ chokes on llvm/GlobalValue.h, complaining of an invalid cast from int to llvm::GlobalValue::LinkageTypes. I receive this error under both Red Hat and Ubuntu and the version of G++ I am using is 4.1.2.
Thanks in advance,
Jared
Oops, forgot to reply to all.
I solved it by moving a project-specific include after the llvm includes. I.e.,
From:
#include “ast.h”
#include “llvm/Module.h”
#include “llvm/Function.h”
#include “llvm/PassManager.h”
…
to:
#include “llvm/Module.h”
#include “llvm/Function.h”
#include “llvm/PassManager.h”
…
#include “ast.h”
I can’t figure out why this gave me the particular error I was receiving, but it solves the problem.