Windows build fails with Clang/MSVC due to missing #include <chrono> and const pointer type error
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 40.3k
- Forks
- 3.7k
- PR merge metrics
- No merged PRs in 30d
Description
Environment
- OS: Windows 11
- Compiler: Clang 19 (via Visual Studio 2022 Build Tools + clang-cl)
- CMake: 3.x
Problem
Building on Windows with ClangCL fails with the following errors:
-
src/ggml-bitnet-mad.cpp line 811 — const pointer mismatch
error: cannot initialize a variable of type 'int8_t *' with an rvalue of type 'const int8_t *'
Fix: change int8_t * to const int8_t * -
Missing #include in 3rdparty/llama.cpp submodule
The following files use std::chrono without explicitly including . On Linux/GCC it is pulled in implicitly,
but Clang on Windows is stricter:
- 3rdparty/llama.cpp/common/common.cpp
- 3rdparty/llama.cpp/common/log.cpp
- 3rdparty/llama.cpp/examples/imatrix/imatrix.cpp
- 3rdparty/llama.cpp/examples/perplexity/perplexity.cpp
Fix: add #include to each file.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/ggml-bitnet-mad.cpp around line 811 and the four listed files under 3rdparty/llama.cpp, checking their std::chrono usage and current includes. Verify the const pointer correction and explicit chrono includes by running the Windows 11 ClangCL CMake build; done means the reported compilation errors no longer occur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100