Clang + LLVM static library binding error on Windows - Why will the characters be different?

After compiling clang and llvm, following the instructions on the llvm website, I am trying to connect to the built-in static libraries in a test application. All code is built using the v110 VS toolkit. Im getting linker errors like "error LNK2001" and "error LNK2019".

An application appears that puts libs in a bucket to resolve the character. With a comprehensive output linker, I see that they are simply being fired:

1> Unused libraries: ... 1> C: \ Sdk \ llvm \ Debug \ lib \ clangTooling.lib ...

Digging a little deeper, I found that the characters in the error message and those in the libraries are not exactly the same.

-That's 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), on referenced by the main function

... as the name of the character " start @ClangTool @tooling @clang @@ QEAAHPEAVToolAction @ 23 the Z @@ .

Now, using "dumpbin / SYMBOLS" in my embedded version of 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 see that the character that is looking for is called " ? @ Run ClangTool @ tools @ clang @@ QAEHPAVToolAction @ 23 @@ Z "

. .

? run @ClangTool @tooling @clang @@QEAAHPEAVToolAction @23 @@Z < <

? run @ClangTool @tooling @clang @@QAEHPAVToolAction @23 @@Z < <

?

0
1

, , LLVM/clang, , 32 , 64 . , 32- . Unresolved Externals ++: Visual ++ - dll .

* , LLVM libs. CMake LLVM/clang ( http://llvm.org/docs/CMake.html) , 64 64- . Windows7 64bit/VisualStudio11 ( , ) . 64- CMake. - 32- .

+3

Source: https://habr.com/ru/post/1541011/


All Articles