Subject: Re: lib install problem
To: David Laight <firstname.lastname@example.org>
From: Steve Tremblett <email@example.com>
Date: 10/26/2002 15:18:47
+---- David Laight wrote:
| On Sat, Oct 26, 2002 at 02:06:54PM -0400, Steve Tremblett wrote:
| > I need to use libnet to inject ethernet frames to test a networking
| > tool I'm writing. I checked /usr/pkgsrc but the version there is
| > outdated so I got the latest version and installed by hand. Everything
| > seems to work ok, but I can't link against the lib no matter what I
| > try. It is a static (".a") lib, if that matters.
| What is the actual file called?
| If it is xxx/libnet.a you should be able to put the filename
| onto the command line (ie no -l and with the 'lib' and '.a').
| cc -o program program.o xxx/libnet.a
| should work.
/home/sjt/tcpip/ether_write % make
gcc -I/usr/pkg/include -O -g -Wall /usr/pkg/lib/libnet.a ether_write.c -o ether_write
/tmp/cc2OpFny.o: In function `main':
/home/sjt/tcpip/ether_write/ether_write.c:29: undefined reference to `libnet_init'
/home/sjt/tcpip/ether_write/ether_write.c:36: undefined reference to `libnet_build_ethernet'
/home/sjt/tcpip/ether_write/ether_write.c:45: undefined reference to `libnet_write'
/home/sjt/tcpip/ether_write/ether_write.c:49: undefined reference to `libnet_destroy'
/home/sjt/tcpip/ether_write/ether_write.c:41: undefined reference to `libnet_destroy'
collect2: ld returned 1 exit status
*** Error code 1