From owner-freebsd-questions Wed Dec 22 12:42: 4 1999 Delivered-To: freebsd-questions@freebsd.org Received: from node11a94.a2000.nl (node11a94.a2000.nl [24.132.26.148]) by hub.freebsd.org (Postfix) with SMTP id 7324714E77 for ; Wed, 22 Dec 1999 12:42:01 -0800 (PST) (envelope-from ronald@node11a94.a2000.nl) Received: (qmail 20405 invoked from network); 22 Dec 1999 20:42:00 -0000 Received: from dlanor.evertsen.nl (10.0.0.3) by node11a94.a2000.nl with SMTP; 22 Dec 1999 20:42:00 -0000 Date: Wed, 22 Dec 1999 21:41:56 +0100 (CET) From: Ronald 'Ko' Klop To: freebsd-questions@freebsd.org Subject: Q: using kvm gives a compile error Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I'm trying to write a program using kvm. But even the simplest program failes to compile. Here is my program iftest.cc: #include #include #include #include int main(int argc,char **argv) { char *nlistf=NULL,*memf=NULL; kvm_t *kvmd; kvmd = kvm_open(nlistf,memf,NULL,O_RDONLY,"kvm: "); if (kvmd==NULL) { printf("error opening kvm\n"); exit(0); } kvm_close(kvmd); return 0; } Compiling gives the following output: g++ iftest.cc /var/tmp/ccOV18281.o: In function `main': /var/tmp/ccOV18281.o(.text+0x26): undefined reference to `kvm_open' /var/tmp/ccOV18281.o(.text+0x55): undefined reference to `kvm_close' I have read the man pages searched the mail archive, but didn't find anything. I also looked at the implementation of top and netstat. But couldn't find a clue about what I am forgetting. Does somebody know how to do this? Greetings, Ronald. PS: I'm trying to do this to get the number of send/received bytes across the ethernet from the kernel. -- Ronald Klop http://node11a94.a2000.nl/~ronald/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message