Home > Software design >  How to get error.h in visual studio or equivalent?
How to get error.h in visual studio or equivalent?

Time:08-14

I have large C project that I inherited and am trying to transfer it from Linux to Visual Studio on Windows. Managed to link required libraries, but one build error just baffles me.

In Linux, someone was including a header <error.h> everywhere, and I can't even find a documentation page to see what it is. First I thought is part of standard library, but I am now beginning to see it's a specific header for Linux OS.

So, how do I include it in Visual studio? I can't even find what it is and am tempted to just rearrange code to use stdexcept header, as the only thing these codes do is abort compilation and printout error messages by using some error(...) function from error.h.

CodePudding user response:

error.h is a header from the GNU C Library. It is not specific to Linux, it is specific to glibc.

It is documented right here (search on the page for error.h).

The functions declared in error.h should not be used in portable code, so getting rid of code that uses them is not a bad idea. Alternatively, it is not difficult to implement them.

  • Related