Much of the code I have written as part of my day job uses the rather excellent libnids. However, there are a few bugs in version 1.23 relating to packets with radiotap headers or code which tries to read from multiple pcap files in sequence.
The radiotap bug was fixed by Michal Pecio, the pcap offline bug by myself. Both fixes are very simple (1 and 4 lines respectively) and I have packaged up the changes into release 1.24.
Hopefully Rafal Wojtczuk, the libnids author, will publish these changes on the Sourceforge site soon. Until then you can grab a patch between the two versions or a complete distribution tarball below.
Update: As of today (March 14th 2010) Rafal has updated libnids to v1.24 with a number of other changes. You can grab it from the official libnids website. Thanks!