#include< date/date.h>引用了许多错误

发布于 01-18 18:47 字数 1039 浏览 2 评论 0原文

我正在尝试在编辑框中显示程序执行时间。我在stackoverflow上找到了一些示例,例如下面的代码。

using namespace std;
using namespace date;
ostringstream out;
auto start = chrono::system_clock::now();

//some program execution

auto finish = chrono::system_clock::now();
out << finish - start;
string s = out.str();
cout << s << '\n';

我已经安装了库#include&lt; date/date.h&gt;通过VCPKG。但是问题是:一旦我做#include&lt; date/date.h&gt;&运行代码,带有本地Windows调试器的代码,正如下面拍摄的SNAP射击中所示的许多错误。

我的意思是,包括&lt; date/date.h&gt;库导致错误。

如何避免这个问题?

非常感谢!

更新

#include "pch.h"
#include "framework.h"
#include "MFCApplication2.h"
#include "MFCApplication2Dlg.h"
#include "afxdialogex.h"
#include <iostream>
#include <date/date.h>

void CMFCApplication2Dlg::OnBnClickedButton1()
{

    //I have cleared the code inside, but errors yet appear

}

I am trying to show in an edit box a program execution time. I have found some examples at Stackoverflow like the code here below.

using namespace std;
using namespace date;
ostringstream out;
auto start = chrono::system_clock::now();

//some program execution

auto finish = chrono::system_clock::now();
out << finish - start;
string s = out.str();
cout << s << '\n';

I have installed the library #include <date/date.h> via vcpkg. But the problem is: as soon as I do #include <date/date.h>, and run code with Local Windows Debugger a numerous mistake is happening as indicated in the snap shot below.

enter image description here

I mean, simple including of <date/date.h> library leads to errors.

How can I avoid this issue?

Many thanks in advance!

UPD

#include "pch.h"
#include "framework.h"
#include "MFCApplication2.h"
#include "MFCApplication2Dlg.h"
#include "afxdialogex.h"
#include <iostream>
#include <date/date.h>

void CMFCApplication2Dlg::OnBnClickedButton1()
{

    //I have cleared the code inside, but errors yet appear

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文