Thread: How to Load .lib files with lcc-32 compiler

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    54

    How to Load .lib files with lcc-32 compiler

    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'

  2. #2
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    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.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    54
    the docs arent helpful at all, if anyone here has experience with pcap, please let me know how you load the lib files

  4. #4
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    869
    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).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dos commands hehe
    By Carp in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-17-2003, 02:51 PM
  2. How to convert .a files to .lib files?
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 06-28-2002, 05:43 PM
  3. what are all the compiler files
    By 0927 in forum C++ Programming
    Replies: 2
    Last Post: 01-29-2002, 12:42 AM
  4. displaying text files, wierd thing :(
    By Gades in forum C Programming
    Replies: 2
    Last Post: 11-20-2001, 05:18 PM
  5. Winsock .lib files?
    By SyntaxBubble in forum Windows Programming
    Replies: 7
    Last Post: 10-30-2001, 06:44 AM