error: no matching function for call to ‘std::chrono::_V2::system_clock::to_time_t(std::chrono::time_point<android::base::boot_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >&)’
时间: 2023-08-16 07:08:50 浏览: 354
这个错误的原因可能是你在使用 `std::chrono::system_clock::to_time_t()` 函数时传入的时间点类型不正确。这个函数接受的参数应该是 `std::chrono::system_clock::time_point` 类型,而你传入的是 `std::chrono::time_point<android::base::boot_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >` 类型,这两者是不兼容的。
你需要检查一下你的代码,确认你在调用 `to_time_t()` 函数时传入了正确的时间点类型。如果确实需要将 `std::chrono::time_point<android::base::boot_clock, std::chrono::duration<long int, std::ratio<1, 1000000000> > >` 转换为时间戳,你可能需要编写自己的转换函数,或者使用第三方库进行转换。
相关问题
[Error] no matching function for call to 'std::basic_ofstream<char>::basic_ofstream(std::string&)'
This error occurs when the std::ofstream constructor is given a string argument instead of a character array (const char*) argument. To fix this error, you can pass the string argument as a c_str() of the string, like this:
```
std::string filename = "example.txt";
std::ofstream outfile(filename.c_str());
```
Alternatively, you can use the constructor that takes a std::string_view argument, which was introduced in C++17:
```
std::string filename = "example.txt";
std::ofstream outfile(std::string_view(filename));
```
阅读全文
相关推荐















