After compiling clang and llvm following the instruction on the llvm website I try linking to the built static libs in a test app. All code is built with v110 of the VS toolset. Im getting linker errors of type "error LNK2001" and "error LNK2019".
The app appears to put the libs in the bucket for symbol resolution. With verbose linker output i can see that they are just being dismissed:
1> Unused libraries: ... 1> C:\Sdk\llvm\Debug\lib\clangTooling.lib ...
Digging a little deeper i have found that the symbols in the error message and the ones in the libs are not quite the same.
-Here is an example-
Linker error =>
*unresolved external symbol "public: int __cdecl clang::tooling::ClangTool::run(class clang::tooling::ToolAction )" (?run@ClangTool@tooling@clang@@QEAAHPEAVToolAction@23@@Z) referenced in function main
...giving "?run@ClangTool@tooling@clang@@QEAAHPEAVToolAction@23@@Z" as the symbol name.
Now using "dumpbin /SYMBOLS" on my built version of the clangTooling.lib =>
*FDA 00000000 UNDEF notype () External | ?run@ClangTool@tooling@clang@@QAEHPAVToolAction@23@@Z (public: int __thiscall clang::tooling::ClangTool::run(class clang::tooling::ToolAction ))
... i can see the the symbol im looking for is called "?run@ClangTool@tooling@clang@@QAEHPAVToolAction@23@@Z"
There is a very subtle difference near the beginning of the address. Here they are again side by side for comparison.
?run@ClangTool@tooling@clang@@QEAAHPEAVToolAction@23@@Z << Error Message
?run@ClangTool@tooling@clang@@QAEHPAVToolAction@23@@Z << Dumpbin Output
Why is it that these do not match?
Thanks