Reputation: 573
I'm writing a front-end for LLVM
with java. My front-end produces .ll
files. Then I use the following commands to convert these files to an executable file:
1. for each .ll file I use `'llvm-as file.ll'` to create a bitcode file
2. use `'llvm-ld -o executable my-bitcode-files -L/usr/lib/i386-linux-gnu -lstdc++'` to
generate an executable file.
Then when I run the executable file, I get the following error:
LLVM ERROR: Program used external function '_Znwm' which could not be resolved!
What should I do to resolve this issue?
Upvotes: 2
Views: 1606
Reputation: 9324
You need to generate native executable, not the IR + wrapper. Try to add -native to llvm-ld cmdline.
Upvotes: 2