title: Libpcap example doesnt work but project builds in eclipse?
body: <p>I am running the following libpcap example on Ubuntu, within eclipse:</p>
  
  <p><a href="http://www.tcpdump.org/pcap.html" rel="nofollow">http://www.tcpdump.org/pcap.html</a></p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;pcap.h&gt;
  
  int main(int argc, char *argv[])
  {
      char *dev, errbuf[PCAP_ERRBUF_SIZE];
  
      dev = pcap_lookupdev(errbuf);
      if (dev == NULL) {
          fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
          return(2);
      }
      printf("Device: %s\n", dev);
      return(0);
  }
  </code></pre>
  
  <p>I included the library path to the libpcap.a file in the eclipse settings for the GCC C++ linker. When I build the project I get:</p>
  
  <p>g++ -L/usr/lib/x86_64-linux-gnu/ -o"test"  ./src/test.o   -llibpcap.a
  /usr/bin/ld: cannot find -llibpcap.a
  collect2: ld returned 1 exit status
  make: <em>*</em> [test] Error 1</p>
  
  <p>I dont see why the path is /usr/bin/ld when I set it to "/usr/lib/x86_64-linux-gnu/" within the linker library search path (libraries -L)? I also set (libraries -l) within GCC C++ linker to "libpcap.a"</p>
  
  <p>Do I need to set both? Have I done this correctly? My pcap files are located at /usr/lib/x86_64-linux-gnu/</p>
  
  <p>Interestingly if I write non-pcap C++ but include pcap.h the code builds with no errors.</p>