Hello, does anyone know how to load .lib files?
I keep getting undefined reference errors.
pktsnf.obj .text: undefined reference to '_pcap_findalldevs'
pktsnf.obj .text: undefined reference to '_pcap_freealldevs'
Hello, does anyone know how to load .lib files?
I keep getting undefined reference errors.
pktsnf.obj .text: undefined reference to '_pcap_findalldevs'
pktsnf.obj .text: undefined reference to '_pcap_freealldevs'
Consult your compiler docs?
A common convention is -L for specifying library directories, and -l for specifying the library you want to link in, possibly without the extension.
the docs arent helpful at all, if anyone here has experience with pcap, please let me know how you load the lib files
It has absolutely nothing to do with pcap, it's to do with your compiler. I'm vary experienced with pcap, but I don't use "lcc-32". When I compile a pcap program, I do:
gcc -o executablename sourcefile.c -lpcap -L/path/to/library
The -L/path/to/library is optional, used if my libpcap library file was outside the standard list of places to look.
As I said above, the -L specifies the directory to search in, and -l specifies the name of the library. In my environment, -lpcap implicitly looks for the file libpcap.*.
This is the same way one links any non-standard library in gcc. pcap is not special.
If the docs are not helpful (as you say), then I suggest you find a new compiler, because not documenting something as fundamental as linking shared libraries is extremely bad. Failing that, if you must use this compiler, I suggest you contact any forum/mailing list that is dedicated to the use of this compiler, or failing that, contact the author(s).