chrono class trouble

  • Thread starter Thread starter MyCatAlex
  • Start date Start date
M

MyCatAlex

Guest
Hi there,

I have this C++ project which operates at a very high speed. As a result I need to measure some intervals, and I use chrono class for that. I get Intelisence highlights and compile errors. This is the fraction of my code with all chrone events inside.

switch (pcom.rFlag)
{
case 0:
{
ccou += 1; // initial value is -1
if (ccou == 0)
{
std::chrono::time_point<std::chrono::system_clock> start, end;
start = std::chrono::system_clock::now();
}
pfArray[cou] = (float)pcom.s0[pixelCountr] * pcom.loc.sphHarm_R[cou];
pfArray[cou] = (float)pcom.s0[pixelCountr] * pcom.loc.sphHarm_I[cou];
if (ccou == 76799)
{
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_microseconds = end - start;
==> std::time_t end_time = std::chrono::system_clock::to_time_t(end);

std::cout << "\n\n System.pause \n\n";
system("pause");
}
break;
}

I borrowed this code from this site. I marked the variables highlighted by Intellisense by making them bold printed. I don't understand the statement I marked with an arrow and don't understand how the syntax errors came about.

The compiler declares 9 errors, in fact I see only 5. Welcome to VS 2019!


Severity Code Description Project Path File Line Suppression State
Error C2563 mismatch in formal parameter list MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1108

Severity Code Description Project Path File Line Suppression State
Error C2664 '__time64_t std::chrono::system_clock::to_time_t(const std::chrono::system_clock::time_point &) noexcept': cannot convert argument 1 from 'overloaded-function' to 'const std::chrono::system_clock::time_point &' MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1109


Severity Code Description Project Path File Line Suppression State
Error C2039 'time_t': is not a member of 'std' MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1109

Severity Code Description Project Path File Line Suppression State
Error C2065 'start': undeclared identifier MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1108

Severity Code Description Project Path File Line Suppression State
Error C2659 '=': function as left operand MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D C:\CPlusPlus_Projects\MFCaptureD3D\MFCaptureD3D\device.cpp 1107






Need help. Thanks.

- MyCatAlex

Continue reading...
 

Similar threads

M
Replies
0
Views
216
MyCatAlex
M
M
Replies
0
Views
112
MyCatAlex
M
Back
Top