diff --git a/source/api_c/include/deepmd.hpp b/source/api_c/include/deepmd.hpp index 3bb81078c1..1867ac34ad 100644 --- a/source/api_c/include/deepmd.hpp +++ b/source/api_c/include/deepmd.hpp @@ -8,6 +8,7 @@ This header-only library provides a C++ 11 interface to the DeePMD-kit C API. #include #include +#include #include #include #include @@ -34,7 +35,7 @@ struct deepmd_exception : public std::runtime_error { */ #define DP_CHECK_OK(check_func, dp) \ const char *err_msg = check_func(dp); \ - if (strlen(err_msg)) \ + if (std::strlen(err_msg)) \ throw deepmd::hpp::deepmd_exception(std::string(err_msg)); template