Getting Started: Building and Running Clang - libclang.lib issue!

I’m hoping to use Libclang to Parse C++ files, using the likes of #include <clang-c/Index.h>, AST, CXTranslationUnit etc, but I’m running into some issues…

Following the guide found at the link below, ‘Using Visual Studio’ section:

https://clang.llvm.org/get_started.html

Not using git, so manually download the necessary zip file from the ‘code menu’ which appears to be ‘LLVM-21.1.7-win64’ :

Unzip the files into a folder, add an empty folder for the build named ‘…BUILD1’
Environment variables for CMAKE, LLVM AND gnuwin32 are also established.

The command used to make the binaries:

cmake -DLLVM_ENABLE_PROJECTS=clang -G “Visual Studio 17 2022” -A Win32 -Thost=x64 ..\llvm

Open LLVM.sln in Visual Studio.
Build “ALL_BUILD”

When build completes, open C++ project, add <clang-c/Index.h> + a few lines of Clang sample code, #include <clang-c/Index.h>, AST, CXTranslationUnit etc.


VS Project Settings:

C/C++ > General > Additional Include Directories: 
$(LLVM)/clang/include; $(WXWIN)/include/msvc;$(WXWIN)/include;

Linker > General > Additional Library Directories: 
$(LLVM)/'...BUILD1/Debug/lib; $(WXWIN)/lib/vc_lib

Linker > Input > Additional Library Dependencies: 
libclang.lib;

C/C++ > Preprocessor > Preprocessor Definitions > 
WIN32
_DEBUG
_WINDOWS
__WXMSW__
__WXDEBUG__
_CRT_SECURE_NO_WARNINGS
_SCL_SECURE_NO_WARNINGS

On building the vs project, the error is generated:

LINK : fatal error LNK1104: cannot open file ‘libclang.lib’

On searching the LLVM CMake build folder, ‘libclang.lib’ is not found.

Not to get too far ahead, but read somewhere else this file must be added to the vs project folder for things to work properly, but for the time being the file doesn’t appear to exist anywhere.

How to fix this issue and is there an option to reduce the 2-3 hours build times while troubleshooting?


IDE: VS2025
Project host lang: Standard C++, wxWidgets
Project Config: Debug x86
OS: Win 10 x64