If you try to build a simplest application on Linux with the Net-SNMP library (open a session and close the session - everything) you get this error
/usr/include/net-snmp/library/snmp_api.h:706:8: error: unknown type name 'netsnmp_transport' I suppose that I didn’t specify any compilation flag, or I didn’t connect it to anybody.
In essence, a five-line program:
#include <stdio.h> #include <stdlib.h> #include <net-snmp/net-snmp-config.h> #include <net-snmp/session_api.h> int main(int argc, char **argv) { struct snmp_session s; void * session; // Выполняем инициализацию переменных snmp_sess_init(&s); session = snmp_sess_open(&s); // Закрываем сессию rc = snmp_sess_close(&s); if (rc == 0) { printf("Неудачное завершение сессии\n"); } else { printf("Программа завершилась нормально\n"); } return 0; } Can someone explain - what is the reason for the situation?
#include <net-snmp/library/snmp_transport.h>- aleksandr barakin