[LLVMdev] [LLVMDev] Trouble Linking

Jeff Kunkel jdkunk3 at gmail.com
Fri Oct 15 08:11:19 PDT 2010


I am writing my register allocator directly in the LLVM tree, and I am
having trouble linking my project on windows msvc 10.0 compiler. The
error are below, but let me say what I have changed.
1. I added "(void) llvm::createJDKunkRegisterAllocator();" to the
struct ForcePassLinking::ForcePassLinking() method in
"llvm\include\llvm\LinkAllPasses.h"
2. I added "FunctionPass* createJDKunkRegisterAllocator();" to header
"llvm\CodeGen\Passes.h."
3. I implemented "FunctionPass* createJDKunkRegisterAllocator()" in my cpp file.

I know the api change said some items were changed, and it has worked
until the api change e-mail came out. However, I cannot figure out
what I need to change to have this project link.

2>     Creating library C:/Users/JDKunk/Documents/Visual Studio
2010/Projects/VSllvm/lib/Debug/bugpoint.lib and object
C:/Users/JDKunk/Documents/Visual Studio
2010/Projects/VSllvm/lib/Debug/bugpoint.exp
2>bugpoint.obj : error LNK2019: unresolved external symbol "class
llvm::FunctionPass * __cdecl
llvm::createJDKunkRegisterAllocator(void)"
(?createJDKunkRegisterAllocator at llvm@@YAPAVFunctionPass at 1@XZ)
referenced in function "public: __thiscall `anonymous
namespace'::ForcePassLinking::ForcePassLinking(void)"
(??0ForcePassLinking@?A0xb2143f5b@@QAE at XZ)

4>     Creating library C:/Users/JDKunk/Documents/Visual Studio
2010/Projects/VSllvm/lib/Debug/opt.lib and object
C:/Users/JDKunk/Documents/Visual Studio
2010/Projects/VSllvm/lib/Debug/opt.exp
4>opt.obj : error LNK2019: unresolved external symbol "class
llvm::FunctionPass * __cdecl
llvm::createJDKunkRegisterAllocator(void)"
(?createJDKunkRegisterAllocator at llvm@@YAPAVFunctionPass at 1@XZ)
referenced in function "public: __thiscall `anonymous
namespace'::ForcePassLinking::ForcePassLinking(void)"
(??0ForcePassLinking@?A0x853fd888@@QAE at XZ)

Thanks,
Jeff Kunkel



More information about the llvm-dev mailing list