[LLVMdev] linking llvm libraries with bitcode files
ali.sedaghatbaf at gmail.com
Tue Jan 8 21:32:23 PST 2013
I'm developing an llvm-based compiler and when I try to generate
executable file the following error occurs:
./bin/llvmcode.s:35: undefined reference to `operator new(unsigned
Note that in the generated IR, the function '@_Znam' is called which is
located in one of llvm libraries. So, I should have linked the generated
assembly file with that library. Here is the code I used to do that:
g++ -g ./bin/llvmcode.s \`llvm-config --cppflags --ldflags --libs core
jit native\` -O3 -o executable -rdynamic
What's wrong with this code that causes the above error, and what's the
best way to generate an executable file from ll files?
Any assistance would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev