Devo convertire questo programma da C a C++
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <OV/OVsnmp.h>
#include <OV/ovsnmpapi.h>
#include <winsock.h>
char string[20];
struct getNonBlocking_info {
int waiting ;
int error ;
OVsnmpPdu *response ;
} ;
...
OVsnmpSession*
OVsnmpEventOpen(const char *peername, const char *entityName, void (*callback)(),
void *callback_data,
const char *filter);
// Callback function that is notified
// when a trap arrives.
void callback(int type,
OVsnmpSession *session,
OVsnmpPdu *response,
void *userData)
{
...
}//callback
int main()
{
OVsnmpSession *trapSession;
struct getNonBlocking_info info ;
...
trapSession = OVsnmpEventOpen("localhost", NULL, callback, (void *) &info,
".1.3.6.1.4.*.0.58720260,58720261,58720263,5872026 4.");
...
return(0);
}
In C funziona perfettamente, quando provo a compilarlo in C++ mi da il seguente errore:
c:\programmi\microsoft visual studio\myprojects\provacpp\main.cpp(90) : error C2664: 'OVsnmpEventOpen' : cannot convert parameter 3 from 'void (int,struct SNMPSession *,struct SNMPPdu *,void *)' to 'void (__cdecl *)(void)' None of the functions with this name in scope match the target type
Plz Help Me!