简体   繁体   English

是 VS Code MinGW 中的未定义错误。 赢32

[英]is Undefined Errors in VS Code MinGW Vs. Win32

I am facing a problem with my VSCode.我的 VSCode 有问题。

when i use MinGW it shows me errors of identifier ... is Undefined which does not affect the execution of the code,当我使用 MinGW 时,它向我显示了identifier ... is Undefined错误identifier ... is Undefined ,它不会影响代码的执行,
but when I switch to Win32 all these errors disappears.但是当我切换到 Win32 时,所有这些错误都消失了。 and that happens even though I included the needed Libraries.即使我包含了所需的库,也会发生这种情况。 I wanna know if some one can help me out What is the problem and how can I solve it.我想知道是否有人可以帮助我解决问题是什么,我该如何解决。

here are my headers:这是我的标题:

#include <iostream>
#include <vector>
#include <tuple>
#include <fstream>
#include <algorithm>
#include <windows.h>
#include <ctime>

if I write a simple code for example something deals with time like this:如果我写一个简单的代码,例如一些处理时间的东西:

int main()
{

    time_t now = time(0);
    cout<<ctime(&now);

    return 0;
}

it shows me erros like that only when I use MinGW只有当我使用 MinGW 时,它才会向我显示这样的错误

identifier "make_tuple" is undefined
identifier "get" is undefined
identifier "time" is undefined
identifier "localtime" is undefined
identifier "asctime" is undefined
identifier "ctime" is undefined

Make sure you use std:: prefix for those functions.确保对这些函数使用std::前缀。

Instead of make_tuple , use std::make_tuple , etc.而不是make_tuple ,使用std::make_tuple等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM