public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* Auparse library event...............
@ 2008-01-18  8:58 kunal chandarana
  2008-01-18 11:03 ` Valdis.Kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: kunal chandarana @ 2008-01-18  8:58 UTC (permalink / raw)
  To: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 1080 bytes --]

+#include <stdio.h>
+#include "auparse.h"
+#include <stdlib.h>
+#include <malloc.h>

int main()
{
    auparse_state_t *au;

    au = auparse_init(AUSOURCE_LOGS, NULL);
    if (au == NULL)
        exit(1);

    if (!ausearch_set_param(au, "auid", "=", "500", AUSEARCH_STOP_EVENT))
        exit(1);

    while (ausearch_next_event(au)) {
        if (auparse_find_field(au, "auid")) {
            printf("auid=%s\n", auparse_interpret_field(au));
        }
    }
    auparse_destroy(au);
}



I tried the above program for but after compilation its giving following
linking error.

/tmp/ccMo3ClJ.o: In function `main':
parselib.c:(.text+0x21): undefined reference to `auparse_init'
parselib.c:(.text+0x61): undefined reference to `ausearch_set_param'
parselib.c:(.text+0x84): undefined reference to `auparse_find_field'
parselib.c:(.text+0x93): undefined reference to `auparse_interpret_field'
parselib.c:(.text+0xae): undefined reference to `ausearch_next_event'
parselib.c:(.text+0xbd): undefined reference to `auparse_destroy'
collect2: ld returned 1 exit status


Do help.......

[-- Attachment #1.2: Type: text/html, Size: 1583 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Auparse library event...............
  2008-01-18  8:58 Auparse library event kunal chandarana
@ 2008-01-18 11:03 ` Valdis.Kletnieks
  2008-01-18 11:10   ` Valdis.Kletnieks
  0 siblings, 1 reply; 3+ messages in thread
From: Valdis.Kletnieks @ 2008-01-18 11:03 UTC (permalink / raw)
  To: kunal chandarana; +Cc: linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]


> I tried the above program for but after compilation its giving following
> linking error.
> 
> /tmp/ccMo3ClJ.o: In function `main':
> parselib.c:(.text+0x21): undefined reference to `auparse_init'
> parselib.c:(.text+0x61): undefined reference to `ausearch_set_param'
> parselib.c:(.text+0x84): undefined reference to `auparse_find_field'
> parselib.c:(.text+0x93): undefined reference to `auparse_interpret_field'
> parselib.c:(.text+0xae): undefined reference to `ausearch_next_event'
> parselib.c:(.text+0xbd): undefined reference to `auparse_destroy'
> collect2: ld returned 1 exit status

Smells suspiciously like you forgot to pass "-laudit" when linking.


[-- Attachment #1.2: Type: application/pgp-signature, Size: 226 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Auparse library event...............
  2008-01-18 11:03 ` Valdis.Kletnieks
@ 2008-01-18 11:10   ` Valdis.Kletnieks
  0 siblings, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2008-01-18 11:10 UTC (permalink / raw)
  Cc: kunal chandarana, linux-audit


[-- Attachment #1.1: Type: text/plain, Size: 188 bytes --]

On Fri, 18 Jan 2008 06:03:00 EST, Valdis.Kletnieks@vt.edu said:

> Smells suspiciously like you forgot to pass "-laudit" when linking.

Caffiene first, answer mail second. :)    -lauparse

[-- Attachment #1.2: Type: application/pgp-signature, Size: 226 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-18 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-18  8:58 Auparse library event kunal chandarana
2008-01-18 11:03 ` Valdis.Kletnieks
2008-01-18 11:10   ` Valdis.Kletnieks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox