Hello,
try to include <time.h> .
Regards, Guido
Visual Studio 2019: Identifier "time_t" undefined
Caffeinated Pizza
1
Reputation point
Very simple header file:
#ifndef _PTIME_H
#define _PTIME_H
#pragma once
#include <ctime>
class PTime
{
public:
PTime();
~PTime();
private:
time_t now;
};
#endif
Is giving me an error Identifier "time_t" is undefined. How is this possible? I included the proper header file. Why is Visual Studio 2019 complaining about time_t?
2 answers
Sort by: Most helpful
-
Guido Franzke 2,196 Reputation points
2021-02-25T06:53:01.28+00:00 -
WayneAKing 4,921 Reputation points
2021-02-25T11:29:51.977+00:00 Are you getting a compile error, or an Intellisense error?
If the latter, try using the option to rescan the solution
found under the Project menu.Sometimes when code is added bit by bit Intellisense does
not pick up all of the changes automatically. Doing a Rescan
forces it to process all of the code in its current state.- Wayne