title: Using libpcap.dylib on a kext
body: <p>I am writing a kext driver for OS X and would like to use functions from the library <code>libpcap.dylib</code>. Libpcap.dylib lives in /usr/lib on OS X. Can it be used from kernel space? How can I use libpcap.dylib from a kext using Xcode?</p>
  
  <p>I manage to compile -- (-lpcap apears as link option) but:</p>
  
  <ul>
  <li>got an warning on <code>"unexpected dylib"</code> by linker. It is clear that is misplaced somehow.</li>
  <li>kextload can't resolve libpcap dependencies.</li>
  <li>kextlibs shows only libs that I include thru OsBundleLibraries suggesting that my dylib is ignored.</li>
  </ul>
  
  <p>I am aware of similar question <a href="https://stackoverflow.com/questions/4189397/linking-dylibs-in-kexts">Linking Dylibs in Kexts?</a> but want to know if someone have have used libpcap on a kext.</p>