Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,359 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Question:
Aside from just adding the error to the ignore list in Visual Studio, is there a way to get Visual Studio to recognize POSIX-related functions?
Visual Studio Version: Community 2022 (64-bit) v17.12.3
Workload: Linux development with C++
Code Snippet:
#include <stdio.h>
#include <time.h>
int main()
{
struct timespec ts;
double time;
clock_gettime(CLOCK_REALTIME, &ts);
time = ts.tv_sec + (ts.tv_nsec / 1e9);
printf("Time:%f\n", time);
return 0;
}
Error Code:
Linux Terminal Result:
pi@bpi-iot-ros-ai:~/projects/ConsoleApplication1$ ./main
Time:1736924024.770033
Troubleshooting Steps That Taken By Myself:
I tried to Update but the error persisted.