Casting Problem - Compiling code with g++ that works for gcc
Hi all!
I programmed a program that used a c-lib (pcap) compiles in gcc and runs perfectly. But i am not able to compile the same code in g++.
There is a single error, the error is in the line:
error: invalid use of member (did you forget the ‘&’ ?)
in my code:
pcap_loop(this->_handle, -1, (pcap_handler) my_pcap_handler, 0);
I've tried out:
pcap_loop(this->_handle, -1, (pcap_handler*) my_pcap_handler, 0);
and:
pcap_loop(this->_handle, -1, (pcap_handler&) my_pcap_handler, 0);
But it don't works!
defined in pcap.h as:
typedef void(* pcap_handler)(u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data)
Any idea which I make can?
Thanks in advance.
|