Есть несколько различных ошибок:
Код: Выделить всё
incomplete type "std::basic_ios" is not allowed in "date.h"
atomic is not a template in
incomplete type "std::ios_base" is not allowed in
numpunct is not a template in
the global scope has no "clock_t" in
(And several more like the one in ctime)
< /code>
Есть больше, которые, по -видимому, вызваны вышеупомянутыми, например: < /p>
incomplete type "std::ios_base" is not allowed in
Следующие шаги для минимального воспроизводимого примера:
. />
Статическая библиотека с PCH OFF, C ++ 20, C17 (удалить все существующие файлы .h и .cpp) < /li>
Консольное приложение, C ++ 20, C17 < /li>
< /ul>
hourard hIn hin hIn hIn hIn hIn hIn hIn hIn hIn hIn hIn. каталоги.#pragma once
#include
#include
date::sys_time parseISODateString(const std::string& isoDateStr);
< /code>
time.cpp
#include "time.h"
#include
#include
using namespace std;
date::sys_time parseISODateString(const string& isoDateStr) {
if (isoDateStr.empty()) {
return date::sys_time{};
}
istringstream in{ isoDateStr };
date::sys_time tp;
in >> date::parse("%FT%TZ", tp);
if (in.fail())
{
in.clear();
in.exceptions(std::ios::failbit);
in.str(isoDateStr);
in >> date::parse("%FT%T%Ez", tp);
}
return tp;
}
< /code>
Убедитесь, что это строит. < /li>
Добавить ссылку из приложения консоли в статическую библиотеку. Это требуется, поэтому включенное время. PrettyPrint-Override ">#include
#include "time.h"
int main()
{
parseISODateString("2000-01-01T00:00:00.000Z");
std::cout
Попытка построить. < /li>
< /ol>
Подробнее здесь: https://stackoverflow.com/questions/797 ... aks-chrono
Мобильная версия