Skip to content

Windows build fails with Clang/MSVC due to missing #include <chrono> and const pointer type error #489

@coolsumesh

Description

@coolsumesh

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:

  1. 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 *

  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions