You should include the following items in your application:
Linux: In a Linux C/C++ application, include the header files ni4882.h, which contains prototypes for the NI-488.2 calls and constants that you can use in your application.
macOS: On macOS, the header file <NI4882/ni4882.h> should be used.
void gpiberr (char * msg); /*function prototype*/
Then, your application invokes it as follows:
if (Ibsta() & ERR) {
gpiberr("GPIB error");
}