Issue 165827
Summary [Build][Visual Studio] Issue while compiling a LLVM project with Visual Studio 17.14.16
Labels new issue
Assignees
Reporter dvynjli
    I am trying to compile a project that uses LLVM with Visual Studio 17.14.16. I am getting following error with LLVM 21.1.4

> 6>  LLVMAsmPrinter.lib(DwarfDebug.obj) : error LNK2019: unresolved external symbol "public: class std::optional<unsigned int> cdecl llvm::DWARFExpression::Operation::getSubCode(void)const " (?getSubCode@Operation@DWARFExpression@llvm@@QEBA?AV?$optional@I@std@@XZ) referenced in function "public: void cdecl llvm::DwarfDebug::emitDebugLocEntry(class llvm::ByteStreamer &,struct llvm::DebugLocStream::Entry const &,class llvm::DwarfCompileUnit const *)" (?emitDebugLocEntry@DwarfDebug@llvm@@QEAAXAEAVByteStreamer@2@AEBUEntry@DebugLocStream@2@PEBVDwarfCompileUnit@2@@Z)
6> LLVMDebugInfoDWARF.lib(DWARFExpressionPrinter.obj) : error LNK2001: unresolved external symbol "public: class std::optional<unsigned int> __cdecl llvm::DWARFExpression::Operation::getSubCode(void)const " (?getSubCode@Operation@DWARFExpression@llvm@@QEBA?AV?$optional@I@std@@XZ)


There are many other such errors. All of them are from LLVMDebugInfoDWARF.lib and are mostly in the functions marked with `LLVM_ABI` visibility. I was following the instructions from https://llvm.org/docs/GettingStartedVS.html while building LLVM and my cmake command is:
```
cmake -S ./llvm -B build -A x64 -DLLVM_ENABLE_PROJECTS="clang;llvm" -DLLVM_TARGETS_TO_BUILD=X86 -Thost=x64 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>" --fresh
```
I compiled the LLVM using Visual Studio after the cmake in Debug X86 mode.
LLVM version 21.1.1 also results in the same error.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to