Skip to content

LLM inference in C/C++

C++ ggml

llama : add missing headers (#28566)

Pepper Grayca86fb222e00
diff --git a/ggml/src/gguf.cpp b/ggml/src/gguf.cpp
index 6c7b581781..144a8edf89 100644
--- a/ggml/src/gguf.cpp
+++ b/ggml/src/gguf.cpp
@@ -9,6 +9,7 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <cerrno>
#include <map>
#include <new>
#include <stdexcept>
diff --git a/src/llama-graph.h b/src/llama-graph.h
index b486578c13..cc4110639d 100644
--- a/src/llama-graph.h
+++ b/src/llama-graph.h
@@ -6,6 +6,7 @@
#include "llama-adapter.h"
#include <cstdint>
+#include <cstdlib>
#include <vector>
#include <memory>
#include <set>
diff --git a/src/llama-mmap.cpp b/src/llama-mmap.cpp
index 4d183cbc9c..715a6e3548 100644
--- a/src/llama-mmap.cpp
+++ b/src/llama-mmap.cpp
@@ -6,6 +6,7 @@
#include <cstring>
#include <climits>
+#include <cstdlib>
#include <stdexcept>
#include <cerrno>
#include <algorithm>
diff --git a/src/llama-vocab.cpp b/src/llama-vocab.cpp
index a69801f087..ee65faf23e 100644
--- a/src/llama-vocab.cpp
+++ b/src/llama-vocab.cpp
@@ -14,6 +14,7 @@
#include <cmath>
#include <cstdarg>
#include <cstring>
+#include <cstdlib>
#include <forward_list>
#include <limits>
#include <map>
diff --git a/tests/test-sampling.cpp b/tests/test-sampling.cpp
index d727ab632a..353a5a1a1d 100644
--- a/tests/test-sampling.cpp
+++ b/tests/test-sampling.cpp
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cmath>
+#include <cstdlib>
#include <string>
#include <vector>
diff --git a/tools/mtmd/deprecation-warning.cpp b/tools/mtmd/deprecation-warning.cpp
index 2b31a9d8b0..615d7577bc 100644
--- a/tools/mtmd/deprecation-warning.cpp
+++ b/tools/mtmd/deprecation-warning.cpp
@@ -1,5 +1,6 @@
#include <clocale>
#include <cstdio>
+#include <cstdlib>
#include <string>
int main(int argc, char** argv) {