I know QNX 6.6 has libpcap as part of its standard libraries.
When I link to libpcap.a and try to use the functions, I get "undefined reference to 'function_name'".
Where is the real libpcap library I need to get it to actually work? Is there someplace I need to download it from?
I am building from Momentics, so there is no single command to build.
Under Linker > other options I have -lpcap, and under Linker > extra libraries I have pcap.
A possibility is that I need to import additional libraries, but libpcap comes with hundreds and I have no idea which ones I would need.
As for output, I get some innoculous building messages followed by my project search path, followed by 18 of these about different functions:
U:/.../target/qnx6/x86/usr/lib\libpcap.a(fad-getad.o): In function pcap_findalldevs':
(.text+0x2b): undefined reference to `getifaddrs'
Some of which are in pcap.h and some aren't. This is the complete list:
'U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(scanner.o): In function
pcap_lex': (.text+0x9c8): undefined reference to
getaddrinfo' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(inet.o): In functionpcap_lookupnet': (.text+0x6d8): undefined reference to
socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(inet.o): In functionpcap_lookupnet': (.text+0x744): undefined reference to
ioctl_socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(inet.o): In functionpcap_lookupnet': (.text+0x7c8): undefined reference to
ioctl_socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): In functionpcap_set_datalink_bpf': (.text+0x16): undefined reference to
ioctl_socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): In functionpcap_stats_bpf': (.text+0x21a): undefined reference to
ioctl_socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o): In functionpcap_setdirection_bpf': (.text+0x3ef): undefined reference to
ioctl_socket' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(pcap-bpf.o):(.text+0x49d): more undefined references toioctl_socket' follow U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(fad-getad.o): In function
pcap_findalldevs': (.text+0x2b): undefined reference togetifaddrs' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(fad-getad.o): In function
pcap_findalldevs': (.text+0x175): undefined reference tofreeifaddrs' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(gencode.o): In function
gen_mcode6': (.text+0x5777): undefined reference tofreeaddrinfo' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(gencode.o): In function
gen_scode': (.text+0x5b36): undefined reference tofreeaddrinfo' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametoaddr': (.text+0x2e): undefined reference togethostbyname' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametoaddrinfo': (.text+0x93): undefined reference togetaddrinfo' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametonetaddr': (.text+0xc4): undefined reference togetnetbyname' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametoport': (.text+0xee): undefined reference togetservbyname' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametoport': (.text+0x10f): undefined reference togetservbyname' U:/shutchinson/QNX/target/qnx6/x86/usr/lib\libpcap.a(nametoaddr.o): In function
pcap_nametoproto': (.text+0x251): undefined reference to `getprotobyname'
You must add another library (libsocket.a) to the linker options. I.e. your linker options must be.............. -lpcap -lsocket.