lovemefan/SenseVoice.cpp

为什么我的编译报错error: ‘strlen’ was not declared in this scope?

Closed this issue · 1 comments

wkitt4 commented

debian12 安装的gcc12

/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc: In function ‘std::string llama_format_tensor_shape(const ggml_tensor*)’:
/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc:44:24: error: ‘strlen’ was not declared in this scope
44 | snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ", %5" PRId64, t->ne[i]);
| ^~~~~~
/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc:13:1: note: ‘strlen’ is defined in header ‘’; did you forget to ‘#include ’?
12 | #include
+++ |+#include
13 |
/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc: In function ‘bool sense_voice_ggml_quantize0(ggml_context*, gguf_context*, const std::string&, const std::string&, ggml_ftype, int, const std::vector<std::__cxx11::basic_string >&, const std::vector<std::__cxx11::basic_string >&)’:
/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc:319:50: error: ‘strcmp’ was not declared in this scope
319 | (new_type == GGML_TYPE_IQ1_M && strcmp(tensor->name, "embed.weight") && strcmp(tensor->name, "ctc.ctc_lo.weight")) ||
| ^~~~~~
/home/wkitt/SenseVoice.cpp/examples/common-ggml.cc:319:50: note: ‘strcmp’ is defined in header ‘’; did you forget to ‘#include ’?
make[2]: *** [examples/CMakeFiles/common.dir/build.make:76:examples/CMakeFiles/common.dir/common-ggml.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:262:examples/CMakeFiles/common.dir/all] 错误 2
make: *** [Makefile:136:all] 错误 2

感谢反馈,当前bug已解决