This seems like it should be simple, but I’ve run into quite a few problems with this. I first tried using cout from <iostream.h>, only to find out that llvm does not seem to support it. Then I tried using raw_ostream and the outs function, and now I’m getting an unresolved external error:
“LLVM ERROR: Program used external function ‘_ZN4llvm4outsEv’ which ciuld not be resolved!”
0. Program arguments: lli test.bc
- Running pass: ‘x86 Machine Code Emitter’ on function ‘@main’
To get the compiler to recognize outs, I had to modify the includes in raw_ostream.h to find a couple of files properly.
Here is the code I’m using:
int main ()
llvm::outs() << “HELLO WORLD”;
I’ve gotten code to run just fine without using any library functions.
Any help would be much appreciated!