Open Stanlyhalo opened 7 months ago
I'll post this as a comment rather then an edit, but a solution I just encountered is that while the macro for cmake for include the available libs is what I'm using, it seems the solution to fix this is to either comment out or remove from the linker "LLVMTableGenCommon.lib".
I would much appreciate if someone replied explaining what this library is for, and if it's important or not before I close this issue, because I don't know if this will cause an issue later on in my project.
Problem When attempting to build a project that calls
llvm::InitializeAllTargets()
using the latest llvm repo changes (as of commit 6aa5388), it throws two compiler errors as denoted in the title.Steps to reproduce 1)
git clone --depth 1 --config core.autocrlf=false https://github.com/llvm/llvm-project.git
2)cmake -S llvm -B build -G "Visual Studio 17 2022" -DLLVM_ENABLE_PROJECTS="lld" -DLLVM_BUILD_LLVM_DYLIB=OFF -DLLVM_LINK_LLVM_DYLIB=OFF -DCMAKE_BUILD_TYPE=Debug
3)cmake --build build
(this is the long part) 4) Start a new project and add the includes, links, and add defines for llvm (I use premake, however I'm following the output of the following messages from a cmake test project)5) Now that a project is setup, write a simple IR builder (anything will do, it's the next part(s) that matter). 6) Follow the guide at https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl08.html. 7) Upon attempting to compile (tested in clang vs22) while trying to call
llvm::InitializeAllTargets()
in the code, it will throw two errors that state what the error is in the title.Notes
Edit*: